diff options
author | Mathias Preiner <mathias.preiner@gmail.com> | 2021-03-16 10:56:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-16 10:56:01 -0700 |
commit | d6890791897ddebf1212d3e3147bf7aeb2415b27 (patch) | |
tree | 51c69ba48a7550b6a7660e2488b4b39cbedba539 /src/api/python/CMakeLists.txt | |
parent | 0d3ea6f2dcaf80d386c7765ee8a708c18e3ed574 (diff) |
cmake: Generate cvc4_export.h and set visibility to hidden. (#6139)
The build system (cmake) will automatically generate an export header
cvc4_export.h, which makes sure that the correct export features are
defined depending on the compiler and target platform. The macro CVC4_EXPORT
replaces CVC4_PUBLIC and its usage is reduced by 2/3.
Co-authored-by: Gereon Kremer <nafur42@gmail.com>
Diffstat (limited to 'src/api/python/CMakeLists.txt')
-rw-r--r-- | src/api/python/CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/api/python/CMakeLists.txt b/src/api/python/CMakeLists.txt index e6a0c71c5..b400c14e5 100644 --- a/src/api/python/CMakeLists.txt +++ b/src/api/python/CMakeLists.txt @@ -49,10 +49,15 @@ add_library(pycvc4 target_link_libraries(pycvc4 cvc4 ${PYTHON_LIBRARIES}) # Disable -Werror and other warnings for code generated by Cython. +# Note: Visibility is reset to default here since otherwise the PyInit_... +# function will not be exported correctly +# (https://github.com/cython/cython/issues/3380). set_target_properties(pycvc4 PROPERTIES COMPILE_FLAGS - "-Wno-error -Wno-shadow -Wno-implicit-fallthrough") + "-Wno-error -Wno-shadow -Wno-implicit-fallthrough" + CXX_VISIBILITY_PRESET default + VISIBILITY_INLINES_HIDDEN 0) python_extension_module(pycvc4) |