summaryrefslogtreecommitdiff
path: root/sys-apps/azure-nvme-utils/files/azure-nvme-utils-werror.patch
blob: 928dcb099e4e47f6b9dda0ecd1658c38e013a09f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From d4afc19a9432e1b7c25269732d18143263f87404 Mon Sep 17 00:00:00 2001
From: James Le Cuirot <jlecuirot@microsoft.com>
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 <jlecuirot@microsoft.com>
---
 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 $<$<CONFIG:Debug>:-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