3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 01:24:08 +00:00

Use CMake's own mechanism for selecting language version if CMake version is new enough

This commit is contained in:
Daniel Schemmel 2018-05-21 07:26:29 +02:00
parent 6938c76950
commit 7467368266
No known key found for this signature in database
GPG key ID: A176732062461ECC

View file

@ -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