Skip to content

Commit

Permalink
Merge pull request #1635 from danielschemmel/cmake-cpp11
Browse files Browse the repository at this point in the history
Use CMake's own mechanism for selecting language version
  • Loading branch information
NikolajBjorner authored May 21, 2018
2 parents 6938c76 + 7467368 commit c390b72
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,17 @@ include(${CMAKE_SOURCE_DIR}/cmake/z3_add_cxx_flag.cmake)
################################################################################
# C++ language version
################################################################################
# FIXME: Use CMake's own mechanism for selecting language version
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
z3_add_cxx_flag("-std=c++11" REQUIRED)
else()
message(AUTHOR_WARNING "Not setting C++ language version for compiler")
endif()
if ("${CMAKE_VERSION}" VERSION_LESS "3.1")
# FIXME: Drop this when we upgrade to newer CMake versions.
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
z3_add_cxx_flag("-std=c++11" REQUIRED)
else()
message(AUTHOR_WARNING "Not setting C++ language version for compiler")
endif()
else ()
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif ()

################################################################################
# Platform detection
Expand Down

0 comments on commit c390b72

Please sign in to comment.