about summary refs log tree commit diff homepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-07-20 19:10:07 +0100
committerDan Liew <delcypher@gmail.com>2017-10-05 13:50:57 +0100
commit48effc8ad27671bedcdfc916381c94c06c96d013 (patch)
tree0b7046096560d972648c2e2a014894df97900f95 /CMakeLists.txt
parent5e6b6342dc2bc9d45a7db8fa45d7e949c55d908b (diff)
downloadklee-48effc8ad27671bedcdfc916381c94c06c96d013.tar.gz
enforce c++11
fixes #314
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 5 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 32933e7c..6e349fa8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -282,23 +282,12 @@ endif()
 ################################################################################
 # C++ version
 ################################################################################
-option(USE_CXX11 "Use C++11" OFF)
-if ("${LLVM_PACKAGE_VERSION}" VERSION_GREATER "3.5.0")
-  message(STATUS "Using LLVM >= 3.5.0. Forcing using C++11")
-  set(USE_CXX11 ON CACHE BOOL "Use C++11" FORCE)
-endif()
-
-if (USE_CXX11)
-  message(STATUS "Enabling C++11")
-  # FIXME: Use CMake's own mechanism for managing C++ version.
-  # Set globally because it is unlikely we would want to compile
-  # using mixed C++ versions.
+if ("${CMAKE_VERSION}" VERSION_LESS "3.1")
   add_global_cxx_flag("-std=c++11" REQUIRED)
-else()
-  # This is needed because with GCC 6 the default changed from gnu++98 to
-  # gnu++14.
-  add_global_cxx_flag("-std=gnu++98" REQUIRED)
-endif()
+else ()
+  set(CMAKE_CXX_STANDARD 11)
+  set(CMAKE_CXX_STANDARD_REQUIRED ON)
+endif ()
 
 ################################################################################
 # Warnings