3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-29 22:40:08 +00:00

Fix build on Mac (#6146)

* Fix finding Python on Mac

On Mac you have to specify the version.
It also works well on other platforms this way.

* Ignore CMake build directories from index

* Fix warning about unused variable in release

The variable is used in debug only,
but it's legit that the compiler does not warn us for that in release.
This commit is contained in:
Victor Paléologue 2022-07-11 18:46:23 +02:00 committed by GitHub
parent 49b7e9084f
commit 8b29f40152
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 18 deletions

View file

@ -160,7 +160,7 @@ list(APPEND Z3_COMPONENT_CXX_DEFINES $<$<CONFIG:RelWithDebInfo>:_EXTERNAL_RELEAS
################################################################################
# Find Python
################################################################################
find_package(PythonInterp REQUIRED)
find_package(PythonInterp 3 REQUIRED)
message(STATUS "PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}")
################################################################################
@ -230,7 +230,7 @@ else()
message(FATAL_ERROR "Platform \"${CMAKE_SYSTEM_NAME}\" not recognised")
endif()
list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS
list(APPEND Z3_COMPONENT_EXTRA_INCLUDE_DIRS
"${PROJECT_BINARY_DIR}/src"
"${PROJECT_SOURCE_DIR}/src"
)
@ -293,8 +293,8 @@ if ((TARGET_ARCHITECTURE STREQUAL "x86_64") OR (TARGET_ARCHITECTURE STREQUAL "i6
set(SSE_FLAGS "-mfpmath=sse" "-msse" "-msse2")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(SSE_FLAGS "-mfpmath=sse" "-msse" "-msse2")
# Intel's compiler requires linking with libiomp5
list(APPEND Z3_DEPENDENT_LIBS "iomp5")
# Intel's compiler requires linking with libiomp5
list(APPEND Z3_DEPENDENT_LIBS "iomp5")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(SSE_FLAGS "/arch:SSE2")
else()
@ -624,7 +624,7 @@ install(
################################################################################
# Examples
################################################################################
cmake_dependent_option(Z3_ENABLE_EXAMPLE_TARGETS
cmake_dependent_option(Z3_ENABLE_EXAMPLE_TARGETS
"Build Z3 api examples" ON
"CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF)
if (Z3_ENABLE_EXAMPLE_TARGETS)