From d6890791897ddebf1212d3e3147bf7aeb2415b27 Mon Sep 17 00:00:00 2001 From: Mathias Preiner Date: Tue, 16 Mar 2021 10:56:01 -0700 Subject: 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 --- src/api/python/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/api/python/CMakeLists.txt') 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) -- cgit v1.2.3