From 5de405be27456665cf40fc96394dcf3a5bb51184 Mon Sep 17 00:00:00 2001 From: Naios Date: Tue, 21 Jul 2015 18:12:21 +0200 Subject: [PATCH] test --- CMakeLists.txt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2686285..e7161c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,14 +27,17 @@ else() CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14) if(NOT COMPILER_SUPPORTS_CXX14) - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - # Clang > 3.4 is ok - else() - message(FATAL_ERROR "Your compiler has no C++14 capability!") - endif() - endif() + # If not given try to enable C++1y + CHECK_CXX_COMPILER_FLAG("-std=c++1y" COMPILER_SUPPORTS_CXX1Y) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") + if(NOT COMPILER_SUPPORTS_CXX1Y) + message(FATAL_ERROR "Your compiler has no C++14 capability!") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y") + endif() + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") + endif() # Find Threads find_package (Threads)