mirror of
https://github.com/Z3Prover/z3
synced 2025-04-06 17:44:08 +00:00
[CMake] Try to unbreak the C example build with older GCC versions
by forcing the language version to be C99.
This commit is contained in:
parent
f27ac24fa0
commit
de3700e1fd
|
@ -7,6 +7,19 @@
|
||||||
# the C++ standard library in resulting in a link failure.
|
# the C++ standard library in resulting in a link failure.
|
||||||
project(Z3_C_EXAMPLE C CXX)
|
project(Z3_C_EXAMPLE C CXX)
|
||||||
cmake_minimum_required(VERSION 2.8.12)
|
cmake_minimum_required(VERSION 2.8.12)
|
||||||
|
|
||||||
|
# Set C version required to C99
|
||||||
|
if ("${CMAKE_VERSION}" VERSION_LESS "3.1")
|
||||||
|
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR
|
||||||
|
("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
set(CMAKE_C_EXTENSIONS OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(Z3
|
find_package(Z3
|
||||||
REQUIRED
|
REQUIRED
|
||||||
CONFIG
|
CONFIG
|
||||||
|
|
Loading…
Reference in a new issue