aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorshiv121231 <127076592+shiv121231@users.noreply.github.com>2026-11-01 01:41:26 +1100
committerGitHub <noreply@github.com>2026-11-01 01:41:26 +1100
commitb610259c74ab3b952fe00e6b5f79e4a1de320ffe (patch)
treed2c09eab561c2765b0be66fe1740792c94673e45 /src/CMakeLists.txt
parentbcb98dc1f7a8d4ab58970292a28b8d9946fbf05e (diff)
Suppress unused warnings with WERROR enabled
Added options to suppress unused warnings when WERROR is enabled.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a2abc7d1b3..c49e252ccb 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -178,6 +178,13 @@ else()
$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-unused-parameter>
$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-missing-field-initializers>)
+ if (ENABLE_WERROR AND (NOT MSVC))
+ add_compile_options(
+ $<$<COMPILE_LANGUAGE:C,CXX>:-Wno-error=unused>
+ $<$<COMPILE_LANGUAGE:C,CXX>:-Wno-error=unused-function>
+ )
+ endif()
+
if (CXX_CLANG OR CXX_ICC OR CXX_APPLE) # Clang, AppleClang, or Intel C++
if (NOT MSVC)
add_compile_options(