mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
[CMake] Use C++11 when building C++ API example.
This is a change requested by @NikolajBjorner (
5f8c97532c (commitcomment-26049417)
).
This commit is contained in:
parent
2770c8f884
commit
92059942e6
|
@ -13,6 +13,22 @@ find_package(Z3
|
||||||
# use this option.
|
# use this option.
|
||||||
NO_DEFAULT_PATH
|
NO_DEFAULT_PATH
|
||||||
)
|
)
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Z3 C++ API bindings require C++11
|
||||||
|
################################################################################
|
||||||
|
if ("${CMAKE_VERSION}" VERSION_LESS "3.1")
|
||||||
|
# Legacy CMake support
|
||||||
|
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Setting C++ version to C++11 not supported for \"${CMAKE_CXX_COMPILER_ID}\"")
|
||||||
|
endif()
|
||||||
|
else ()
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
endif ()
|
||||||
|
|
||||||
message(STATUS "Z3_FOUND: ${Z3_FOUND}")
|
message(STATUS "Z3_FOUND: ${Z3_FOUND}")
|
||||||
message(STATUS "Found Z3 ${Z3_VERSION_STRING}")
|
message(STATUS "Found Z3 ${Z3_VERSION_STRING}")
|
||||||
message(STATUS "Z3_DIR: ${Z3_DIR}")
|
message(STATUS "Z3_DIR: ${Z3_DIR}")
|
||||||
|
|
Loading…
Reference in a new issue