mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-26 16:19:30 +03:00
Demonstrate that compiler is identified as MSVC when VS2014 Clang extension is used
This commit is contained in:
parent
478b6545b2
commit
9eba823269
1 changed files with 4 additions and 0 deletions
|
|
@ -11,15 +11,19 @@ option(UTPP_AMPLIFY_WARNINGS
|
|||
"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"
|
||||
ON)
|
||||
|
||||
message(STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
|
||||
if(MSVC14 OR MSVC12)
|
||||
message(STATUS "Using MSVC compiler")
|
||||
# has the support we need
|
||||
else()
|
||||
include(CheckCXXCompilerFlag)
|
||||
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
|
||||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||
if(COMPILER_SUPPORTS_CXX14)
|
||||
message(STATUS "Specify C++14")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
|
||||
elseif(COMPILER_SUPPORTS_CXX11)
|
||||
message(STATUS "Specify C++11")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
else()
|
||||
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue