File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -11,22 +11,24 @@ option(UTPP_AMPLIFY_WARNINGS
11
11
"Set this to OFF if you wish to use CMake default warning levels; should generally only use to work around support issues for your specific compiler"
12
12
ON )
13
13
14
- message (STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID} " )
15
- if (MSVC14 OR MSVC12 )
16
- message (STATUS "Using MSVC compiler" )
17
- # has the support we need
14
+ if ("${CMAKE_CXX_COMPILER_ID} " STREQUAL "MSVC" )
15
+ # CHECK_CXX_COMPILER_FLAG could be used
16
+ # but MSVC version is preferred for feature requirements
17
+ if (MSVC14 OR MSVC12 )
18
+ # has the support we need
19
+ else ()
20
+ message (WARNING "The MSVC compiler version does not support required C++11 features. Please use a different C++ compiler." )
21
+ endif ()
18
22
else ()
19
23
include (CheckCXXCompilerFlag )
20
24
CHECK_CXX_COMPILER_FLAG ("-std=c++14" COMPILER_SUPPORTS_CXX14 )
21
25
CHECK_CXX_COMPILER_FLAG ("-std=c++11" COMPILER_SUPPORTS_CXX11 )
22
26
if (COMPILER_SUPPORTS_CXX14 )
23
- message (STATUS "Specify C++14" )
24
27
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14" )
25
28
elseif (COMPILER_SUPPORTS_CXX11 )
26
- message (STATUS "Specify C++11" )
27
29
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
28
30
else ()
29
- message (STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler." )
31
+ message (WARNING "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler." )
30
32
endif ()
31
33
endif ()
32
34
You can’t perform that action at this time.
0 commit comments