File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,15 @@ project (sigc++)
30
30
31
31
set ( CMAKE_CXX_STANDARD 17 )
32
32
33
- # Turn on warnings for MSVC
34
- if (MSVC )
35
- # Remove the CMake default of /W3 because when you add /W4, MSVC will complain
36
- # about two warning level flags
33
+ # Turn on warnings for MSVC. Remove the CMake default of /W3 because when you
34
+ # add /W4, MSVC will complain about two warning level flags. This default
35
+ # changed at CMake 3.15 (see
36
+ # https://cmake.org/cmake/help/v3.15/policy/CMP0092.html#policy:CMP0092 for
37
+ # more details)
38
+ if (MSVC AND CMAKE_VERSION VERSION_LESS "13.15" )
37
39
string (REGEX REPLACE "(^|[ \t ])/W[0-9]($|[ \t ])" "\\ 1\\ 2" CMAKE_C_FLAGS "${CMAKE_C_FLAGS} " )
38
40
string (REGEX REPLACE "(^|[ \t ])/W[0-9]($|[ \t ])" "\\ 1\\ 2" CMAKE_CXX_FLAGS
39
41
"${CMAKE_CXX_FLAGS} " )
40
- elseif (CXX_COMPILER_ID )
41
42
endif ()
42
43
43
44
# Add compiler warning flags & turn warnings into errors
You can’t perform that action at this time.
0 commit comments