Skip to content

Feature msvc clang #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 1, 2017
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@ option(UTPP_AMPLIFY_WARNINGS

set(LIB_SUFFIX "" CACHE STRING "Identifier to add to end of lib directory name e.g. 64 for lib64")

if(MSVC14 OR MSVC12)
# has the support we need
if(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
# CHECK_CXX_COMPILER_FLAG could be used
# but MSVC version is preferred for feature requirements
if (MSVC14 OR MSVC12)
# has the support we need
else()
message(STATUS "The MSVC compiler version does not support UnitTest++ C++11 features.")
endif()
else()
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
Expand All @@ -24,7 +30,7 @@ else()
elseif(COMPILER_SUPPORTS_CXX11)
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.")
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
endif()
endif()

Expand Down