Skip to content

Commit 4748f25

Browse files
committed
Removing warnings from Windows Ninja configuration
Windows Ninja build was complaining about /W4 and /W3 being specified, and C++ latest and C++ 17. This fixs those complaints.
1 parent e9ab9e8 commit 4748f25

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ macro(linklibs project)
2626
endmacro()
2727

2828
if(MSVC)
29-
add_compile_options(/WX /W4 /wd4127 /wd4324 /wd4201 /std:c++latest)
29+
# Force to always compile with W4
30+
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
31+
string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
32+
else()
33+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
34+
endif()
35+
add_compile_options(/WX /wd4127 /wd4324 /wd4201)
3036
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
3137
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG")
3238
else()

0 commit comments

Comments
 (0)