@@ -33,8 +33,8 @@ endif()
33
33
# Project version
34
34
################################################################################
35
35
set (Z3_VERSION_MAJOR 4)
36
- set (Z3_VERSION_MINOR 6 )
37
- set (Z3_VERSION_PATCH 1 )
36
+ set (Z3_VERSION_MINOR 8 )
37
+ set (Z3_VERSION_PATCH 5 )
38
38
set (Z3_VERSION_TWEAK 0)
39
39
set (Z3_VERSION "${Z3_VERSION_MAJOR} .${Z3_VERSION_MINOR} .${Z3_VERSION_PATCH} .${Z3_VERSION_TWEAK} " )
40
40
set (Z3_FULL_VERSION_STR "${Z3_VERSION} " ) # Note this might be modified
@@ -99,7 +99,7 @@ set(GIT_DIR "${CMAKE_SOURCE_DIR}/.git")
99
99
if (EXISTS "${GIT_DIR} " )
100
100
# Try to make CMake configure depend on the current git HEAD so that
101
101
# a re-configure is triggered when the HEAD changes.
102
- add_git_dir_dependency("${GIT_DIR } " ADD_GIT_DEP_SUCCESS)
102
+ add_git_dir_dependency("${CMAKE_SOURCE_DIR } " ADD_GIT_DEP_SUCCESS)
103
103
if (ADD_GIT_DEP_SUCCESS)
104
104
if (INCLUDE_GIT_HASH)
105
105
get_git_head_hash("${GIT_DIR} " Z3GITHASH)
@@ -205,9 +205,6 @@ message(STATUS "PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}")
205
205
include (${CMAKE_SOURCE_DIR} /cmake/target_arch_detect.cmake)
206
206
detect_target_architecture(TARGET_ARCHITECTURE)
207
207
message (STATUS "Detected target architecture: ${TARGET_ARCHITECTURE} " )
208
- if ("${TARGET_ARCHITECTURE} " STREQUAL "x86_64" )
209
- list (APPEND Z3_COMPONENT_CXX_DEFINES "-D_AMD64_" )
210
- endif ()
211
208
212
209
213
210
################################################################################
@@ -218,12 +215,17 @@ include(${CMAKE_SOURCE_DIR}/cmake/z3_add_cxx_flag.cmake)
218
215
################################################################################
219
216
# C++ language version
220
217
################################################################################
221
- # FIXME: Use CMake's own mechanism for selecting language version
222
- if (("${CMAKE_CXX_COMPILER_ID} " MATCHES "GNU" ) OR ("${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang" ))
223
- z3_add_cxx_flag("-std=c++11" REQUIRED)
224
- else ()
225
- message (AUTHOR_WARNING "Not setting C++ language version for compiler" )
226
- endif ()
218
+ if ("${CMAKE_VERSION} " VERSION_LESS "3.1" )
219
+ # FIXME: Drop this when we upgrade to newer CMake versions.
220
+ if (("${CMAKE_CXX_COMPILER_ID} " MATCHES "GNU" ) OR ("${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang" ))
221
+ z3_add_cxx_flag("-std=c++11" REQUIRED)
222
+ else ()
223
+ message (AUTHOR_WARNING "Not setting C++ language version for compiler" )
224
+ endif ()
225
+ else ()
226
+ set (CMAKE_CXX_STANDARD 11)
227
+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
228
+ endif ()
227
229
228
230
################################################################################
229
231
# Platform detection
@@ -235,11 +237,14 @@ if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
235
237
list (APPEND Z3_COMPONENT_CXX_DEFINES "-D_USE_THREAD_LOCAL" )
236
238
endif ()
237
239
elseif ("${CMAKE_SYSTEM_NAME} " STREQUAL "Darwin" )
238
- # Does OSX really not need any special flags?
240
+ # Does macOS really not need any special flags?
239
241
message (STATUS "Platform: Darwin" )
240
242
elseif ("${CMAKE_SYSTEM_NAME} " MATCHES "FreeBSD" )
241
243
message (STATUS "Platform: FreeBSD" )
242
244
list (APPEND Z3_COMPONENT_CXX_DEFINES "-D_FREEBSD_" )
245
+ elseif ("${CMAKE_SYSTEM_NAME} " MATCHES "NetBSD" )
246
+ message (STATUS "Platform: NetBSD" )
247
+ list (APPEND Z3_COMPONENT_CXX_DEFINES "-D_NetBSD_" )
243
248
elseif ("${CMAKE_SYSTEM_NAME} " MATCHES "OpenBSD" )
244
249
message (STATUS "Platform: OpenBSD" )
245
250
list (APPEND Z3_COMPONENT_CXX_DEFINES "-D_OPENBSD_" )
@@ -249,6 +254,15 @@ elseif (CYGWIN)
249
254
elseif (WIN32 )
250
255
message (STATUS "Platform: Windows" )
251
256
list (APPEND Z3_COMPONENT_CXX_DEFINES "-D_WINDOWS" )
257
+ elseif (EMSCRIPTEN)
258
+ message (STATUS "Platform: Emscripten" )
259
+ list (APPEND Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS
260
+ "-Os"
261
+ "-s ALLOW_MEMORY_GROWTH=1"
262
+ "-s ASSERTIONS=0"
263
+ "-s DISABLE_EXCEPTION_CATCHING=0"
264
+ "-s ERROR_ON_UNDEFINED_SYMBOLS=1"
265
+ )
252
266
else ()
253
267
message (FATAL_ERROR "Platform \" ${CMAKE_SYSTEM_NAME} \" not recognised" )
254
268
endif ()
@@ -372,9 +386,17 @@ endif()
372
386
################################################################################
373
387
# FIXME: Support ARM "-mfpu=vfp -mfloat-abi=hard"
374
388
if (("${TARGET_ARCHITECTURE} " STREQUAL "x86_64" ) OR ("${TARGET_ARCHITECTURE} " STREQUAL "i686" ))
375
- if (("${CMAKE_CXX_COMPILER_ID} " MATCHES "GNU" ) OR ("${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang" ))
389
+ if (("${CMAKE_CXX_COMPILER_ID} " MATCHES "GNU" ) OR ("${CMAKE_CXX_COMPILER_ID} " MATCHES "Clang" ) OR ("${CMAKE_CXX_COMPILER_ID} " MATCHES "Intel" ))
390
+ if ("${CMAKE_CXX_COMPILER_ID} " MATCHES "Intel" )
391
+ # Intel's compiler requires linking with libiomp5
392
+ list (APPEND Z3_DEPENDENT_LIBS "iomp5" )
393
+ endif ()
376
394
set (SSE_FLAGS "-mfpmath=sse" "-msse" "-msse2" )
377
395
# FIXME: Remove "x.." when CMP0054 is set to NEW
396
+ elseif ("${CMAKE_CXX_COMPILER_ID} " MATCHES "Intel" )
397
+ set (SSE_FLAGS "-mfpmath=sse" "-msse" "-msse2" )
398
+ # Intel's compiler requires linking with libiomp5
399
+ list (APPEND Z3_DEPENDENT_LIBS "iomp5" )
378
400
elseif ("x${CMAKE_CXX_COMPILER_ID} " STREQUAL "xMSVC" )
379
401
set (SSE_FLAGS "/arch:SSE2" )
380
402
else ()
@@ -409,6 +431,29 @@ list(APPEND Z3_DEPENDENT_LIBS ${CMAKE_THREAD_LIBS_INIT})
409
431
################################################################################
410
432
include (${CMAKE_SOURCE_DIR} /cmake/compiler_warnings.cmake)
411
433
434
+ ################################################################################
435
+ # Save Clang optimization records
436
+ ################################################################################
437
+ option (SAVE_CLANG_OPTIMIZATION_RECORDS "Enable saving Clang optimization records." OFF )
438
+
439
+ if (SAVE_CLANG_OPTIMIZATION_RECORDS)
440
+ z3_add_cxx_flag("-fsave-optimization-record" REQUIRED)
441
+ endif ()
442
+
443
+ ################################################################################
444
+ # If using Ninja, force color output for Clang (and gcc, disabled to check build).
445
+ ################################################################################
446
+ if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja" )
447
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
448
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics" )
449
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics" )
450
+ endif ()
451
+ # if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
452
+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color")
453
+ # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color")
454
+ # endif()
455
+ endif ()
456
+
412
457
################################################################################
413
458
# Option to control what type of library we build
414
459
################################################################################
@@ -434,7 +479,7 @@ else()
434
479
endif ()
435
480
436
481
################################################################################
437
- # Postion independent code
482
+ # Position independent code
438
483
################################################################################
439
484
# This is required because code built in the components will end up in a shared
440
485
# library. If not building a shared library ``-fPIC`` isn't needed and would add
0 commit comments