We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe49cbe commit 934bf7bCopy full SHA for 934bf7b
cmake/modules/CompileWarnings.cmake
@@ -14,18 +14,20 @@ macro(wpilib_target_warnings target)
14
15
target_compile_options(${target} PRIVATE ${WARNING_FLAGS})
16
else()
17
- target_compile_options(
18
- ${target}
19
- PRIVATE
20
- /wd4146
21
- /wd4244
22
- /wd4251
23
- /wd4267
24
- /wd4324
25
- /WX
26
- /D_CRT_SECURE_NO_WARNINGS
27
- ${WPILIB_TARGET_WARNINGS}
+ set(WARNING_FLAGS
+ /wd4146
+ /wd4244
+ /wd4251
+ /wd4267
+ /wd4324
+ /D_CRT_SECURE_NO_WARNINGS
+ ${WPILIB_TARGET_WARNINGS}
28
)
+ if(NOT NO_WERROR)
+ set(WARNING_FLAGS ${WARNING_FLAGS} /WX)
+ endif()
29
+
30
+ target_compile_options(${target} PRIVATE ${WARNING_FLAGS})
31
endif()
32
33
# Suppress C++-specific OpenCV warning; C compiler rejects it with an error
0 commit comments