From d4afc19a9432e1b7c25269732d18143263f87404 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Fri, 3 May 2024 12:52:04 +0100 Subject: [PATCH] cmake: Only enable -Werror for debug builds -Werror is very unhelpful for distributions and end users as different (usually newer) compilers will raise warnings that the maintainers may not see. The warnings should get reported upstream, but they shouldn't block users from using the software. Signed-off-by: James Le Cuirot --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d3cd4b..75db578 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ include(cmake/doc.cmake) include(CTest) enable_testing() -add_compile_options(-Wextra -Wall -Werror -std=gnu11 -D_GNU_SOURCE=1) +add_compile_options(-Wextra -Wall $<$:-Werror> -std=gnu11 -D_GNU_SOURCE=1) add_executable(azure-nvme-id src/main.c) set(AZURE_NVME_ID_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/sbin") -- 2.44.0