From 9b48b5ca831590e5d9926c60a5cea759ebb77780 Mon Sep 17 00:00:00 2001 From: Dan Liew <daniel.liew@imperial.ac.uk> Date: Wed, 2 Mar 2016 14:45:01 +0000 Subject: [PATCH] When building with OpenMP make sure libz3 passes extra linker flags. This is necessary for libz3 to be usable from the Python bindings when libz3 is built with gcc or clang. --- examples/c++/CMakeLists.txt | 1 - examples/c/CMakeLists.txt | 1 - src/CMakeLists.txt | 2 ++ 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/c++/CMakeLists.txt b/examples/c++/CMakeLists.txt index 9e8483ac8..85bbd77c7 100644 --- a/examples/c++/CMakeLists.txt +++ b/examples/c++/CMakeLists.txt @@ -2,4 +2,3 @@ add_executable(cpp_example EXCLUDE_FROM_ALL example.cpp) 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/c++") -set_property(TARGET cpp_example APPEND PROPERTY LINK_FLAGS ${Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS}) diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt index 3257729aa..1a14573ac 100644 --- a/examples/c/CMakeLists.txt +++ b/examples/c/CMakeLists.txt @@ -1,4 +1,3 @@ add_executable(c_example EXCLUDE_FROM_ALL test_capi.c) target_link_libraries(c_example PRIVATE libz3) target_include_directories(c_example PRIVATE "${CMAKE_SOURCE_DIR}/src/api") -set_property(TARGET c_example APPEND PROPERTY LINK_FLAGS ${Z3_DEPENDENT_EXTRA_C_LINK_FLAGS}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8fb48af00..c4f6b3334 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -140,6 +140,8 @@ endif() # automatically link against the libs in Z3_DEPENDENT_LIBS target_link_libraries(libz3 INTERFACE ${Z3_DEPENDENT_LIBS}) +set_property(TARGET libz3 APPEND PROPERTY LINK_FLAGS ${Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS}) + # Declare which header file are the public header files of libz3 # these will automatically installed when the libz3 target is installed set (libz3_public_headers