diff options
author | Chris Robinson <[email protected]> | 2020-10-25 14:53:44 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-10-25 14:53:44 -0700 |
commit | 36ecea458a5625df0e07dc4f6fb1c1280d348b3a (patch) | |
tree | 47b9c4af49a09180ffcd9ff6a417aa3a7fe4b71a /CMakeLists.txt | |
parent | 0311f6431c377505b69a0c0b60dcc508b05b5672 (diff) |
Clear /W3 on MSVC since we use /W4
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5facfd2b..4ae87cbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,6 +210,13 @@ if(MSVC) set(C_FLAGS ${C_FLAGS} $<$<COMPILE_LANGUAGE:CXX>:/permissive->) endif() set(C_FLAGS ${C_FLAGS} /W4 /w14640 /wd4065 /wd4268 /wd4324 /wd5030) + # Remove /W3, which is added by default, since we set /W4. Some versions of + # MSVC complain about both /W3 and /W4 being specified. + foreach(flag_var CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + if(${flag_var} MATCHES "-DNDEBUG") + string(REGEX REPLACE "/W3" "" ${flag_var} "${${flag_var}}") + endif() + endforeach() if(NOT DXSDK_DIR) string(REGEX REPLACE "\\\\" "/" DXSDK_DIR "$ENV{DXSDK_DIR}") |