diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2017-07-20 19:10:07 +0100 |
---|---|---|
committer | Dan Liew <delcypher@gmail.com> | 2017-10-05 13:50:57 +0100 |
commit | 48effc8ad27671bedcdfc916381c94c06c96d013 (patch) | |
tree | 0b7046096560d972648c2e2a014894df97900f95 | |
parent | 5e6b6342dc2bc9d45a7db8fa45d7e949c55d908b (diff) | |
download | klee-48effc8ad27671bedcdfc916381c94c06c96d013.tar.gz |
enforce c++11
fixes #314
-rw-r--r-- | CMakeLists.txt | 21 | ||||
-rw-r--r-- | README-CMake.md | 2 |
2 files changed, 5 insertions, 18 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 diff --git a/README-CMake.md b/README-CMake.md index 5828e319..cacdc637 100644 --- a/README-CMake.md +++ b/README-CMake.md @@ -93,6 +93,4 @@ cmake -DCMAKE_BUILD_TYPE=Release /path/to/klee/src * `USE_CMAKE_FIND_PACKAGE_LLVM` (BOOLEAN) - Use `find_package(LLVM CONFIG)` to find LLVM. -* `USE_CXX11` (BOOLEAN) - Use C++11. - * `WARNINGS_AS_ERRORS` (BOOLEAN) - Treat warnings as errors when building KLEE. |