We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28e582f commit e4f9853Copy full SHA for e4f9853
CMakeLists.txt
@@ -253,7 +253,13 @@ function(disable_target_warnings target_name)
253
endif()
254
255
if(MSVC)
256
- # Use /w (lowercase) to disable all warnings including deprecation warnings
+ # Remove any existing warning flags set by the target's own CMakeLists
257
+ get_target_property(existing_flags ${actual_target} COMPILE_OPTIONS)
258
+ if(existing_flags)
259
+ list(FILTER existing_flags EXCLUDE REGEX "^/[Ww][0-4]?")
260
+ set_target_properties(${actual_target} PROPERTIES COMPILE_OPTIONS "${existing_flags}")
261
+ endif()
262
+ # Use /w to disable all warnings
263
target_compile_options(${actual_target} PRIVATE /w)
264
else()
265
target_compile_options(${actual_target} PRIVATE -w)
0 commit comments