mirror of
https://github.com/Z3Prover/z3
synced 2025-08-13 14:40:55 +00:00
Merge pull request #764 from delcypher/cmake_fixes2
Fix a few CMake build bugs
This commit is contained in:
commit
7d37203653
5 changed files with 18 additions and 5 deletions
|
@ -1,4 +1,9 @@
|
||||||
|
# FIXME: We should build this as an external project and consume
|
||||||
|
# Z3 as `find_package(z3 CONFIG)`.
|
||||||
add_executable(cpp_example EXCLUDE_FROM_ALL example.cpp)
|
add_executable(cpp_example EXCLUDE_FROM_ALL example.cpp)
|
||||||
target_link_libraries(cpp_example PRIVATE libz3)
|
target_link_libraries(cpp_example PRIVATE libz3)
|
||||||
target_include_directories(cpp_example PRIVATE "${CMAKE_SOURCE_DIR}/src/api")
|
target_include_directories(cpp_example PRIVATE "${CMAKE_SOURCE_DIR}/src/api")
|
||||||
target_include_directories(cpp_example PRIVATE "${CMAKE_SOURCE_DIR}/src/api/c++")
|
target_include_directories(cpp_example PRIVATE "${CMAKE_SOURCE_DIR}/src/api/c++")
|
||||||
|
if (NOT BUILD_LIBZ3_SHARED)
|
||||||
|
z3_append_linker_flag_list_to_target(cpp_example ${Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS})
|
||||||
|
endif()
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
# FIXME: We should build this as an external project and consume
|
||||||
|
# Z3 as `find_package(z3 CONFIG)`.
|
||||||
add_executable(c_example EXCLUDE_FROM_ALL test_capi.c)
|
add_executable(c_example EXCLUDE_FROM_ALL test_capi.c)
|
||||||
target_link_libraries(c_example PRIVATE libz3)
|
target_link_libraries(c_example PRIVATE libz3)
|
||||||
target_include_directories(c_example PRIVATE "${CMAKE_SOURCE_DIR}/src/api")
|
target_include_directories(c_example PRIVATE "${CMAKE_SOURCE_DIR}/src/api")
|
||||||
|
# This is needed for when libz3 is built as a static library
|
||||||
|
if (NOT BUILD_LIBZ3_SHARED)
|
||||||
|
z3_append_linker_flag_list_to_target(c_example ${Z3_DEPENDENT_EXTRA_C_LINK_FLAGS})
|
||||||
|
endif()
|
||||||
|
|
|
@ -136,9 +136,10 @@ if (NOT MSVC)
|
||||||
set_target_properties(libz3 PROPERTIES OUTPUT_NAME z3)
|
set_target_properties(libz3 PROPERTIES OUTPUT_NAME z3)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Using INTERFACE means that targets that try link against libz3 will
|
# The `PRIVATE` usage requirement is specified so that when building Z3 as a
|
||||||
# automatically link against the libs in Z3_DEPENDENT_LIBS
|
# shared library the dependent libraries are specified on the link command line
|
||||||
target_link_libraries(libz3 INTERFACE ${Z3_DEPENDENT_LIBS})
|
# so that if those are also shared libraries they are referenced by `libz3.so`.
|
||||||
|
target_link_libraries(libz3 PRIVATE ${Z3_DEPENDENT_LIBS})
|
||||||
|
|
||||||
z3_append_linker_flag_list_to_target(libz3 ${Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS})
|
z3_append_linker_flag_list_to_target(libz3 ${Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS})
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ elseif (DOTNET_TOOLCHAIN_IS_MONO)
|
||||||
# We need to give the assembly a strong name so that it can be installed
|
# We need to give the assembly a strong name so that it can be installed
|
||||||
# into the GAC.
|
# into the GAC.
|
||||||
list(APPEND CSC_FLAGS
|
list(APPEND CSC_FLAGS
|
||||||
"/keyfile:${CMAKE_CURRENT_SOURCE_DIR}/Microsoft.Z3.mono.snk"
|
"/keyfile:${CMAKE_CURRENT_SOURCE_DIR}/Microsoft.Z3.snk"
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Unknown .NET toolchain")
|
message(FATAL_ERROR "Unknown .NET toolchain")
|
||||||
|
|
|
@ -110,7 +110,9 @@ set(Z3_JAVA_JAR_SOURCE_FILES
|
||||||
BitVecSort.java
|
BitVecSort.java
|
||||||
BoolExpr.java
|
BoolExpr.java
|
||||||
BoolSort.java
|
BoolSort.java
|
||||||
|
ConstructorDecRefQueue.java
|
||||||
Constructor.java
|
Constructor.java
|
||||||
|
ConstructorListDecRefQueue.java
|
||||||
ConstructorList.java
|
ConstructorList.java
|
||||||
Context.java
|
Context.java
|
||||||
DatatypeExpr.java
|
DatatypeExpr.java
|
||||||
|
@ -136,7 +138,6 @@ set(Z3_JAVA_JAR_SOURCE_FILES
|
||||||
GoalDecRefQueue.java
|
GoalDecRefQueue.java
|
||||||
Goal.java
|
Goal.java
|
||||||
IDecRefQueue.java
|
IDecRefQueue.java
|
||||||
IDisposable.java
|
|
||||||
InterpolationContext.java
|
InterpolationContext.java
|
||||||
IntExpr.java
|
IntExpr.java
|
||||||
IntNum.java
|
IntNum.java
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue