Skip to content
Snippets Groups Projects
Unverified Commit f516eb63 authored by René Milk's avatar René Milk Committed by GitHub
Browse files

Merge pull request #5 from dune-community/visibility_updates

Visibility updates
parents ffc998a5 3c0e3746
No related branches found
No related tags found
2 merge requests!10Fix compilation with new clang,!6Merge pybind
...@@ -113,6 +113,8 @@ function(dune_pybindxi_add_module target_name) ...@@ -113,6 +113,8 @@ function(dune_pybindxi_add_module target_name)
# namespace; also turning it on for a pybind module compilation here avoids # namespace; also turning it on for a pybind module compilation here avoids
# potential warnings or issues from having mixed hidden/non-hidden types. # potential warnings or issues from having mixed hidden/non-hidden types.
set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET "hidden") set_target_properties(${target_name} PROPERTIES CXX_VISIBILITY_PRESET "hidden")
set_target_properties(${target_name} PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE)
if(WIN32 OR CYGWIN) if(WIN32 OR CYGWIN)
# Link against the Python shared library on Windows # Link against the Python shared library on Windows
...@@ -179,3 +181,21 @@ function(dune_pybindxi_add_module target_name) ...@@ -179,3 +181,21 @@ function(dune_pybindxi_add_module target_name)
endif() endif()
endif() endif()
endfunction() endfunction()
macro(dxt_add_make_dependent_bindings)
add_custom_target(dependent_bindings)
if(TARGET bindings AND NOT DXT_NO_AUTO_BINDINGS_DEPENDS)
add_dependencies(bindings dependent_bindings)
endif()
foreach(_mod ${ARGN} )
dune_module_path(MODULE ${_mod}
RESULT ${_mod}_binary_dir
BUILD_DIR)
set(tdir ${${_mod}_binary_dir})
if(IS_DIRECTORY ${tdir})
add_custom_target( ${_mod}_bindings
COMMAND ${CMAKE_COMMAND} --build ${tdir} --target bindings)
add_dependencies(dependent_bindings ${_mod}_bindings)
endif()
endforeach()
endmacro()
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include <map> #include <map>
#include <string> #include <string>
#include <dune/common/visibility.hh>
#include "embed.h" #include "embed.h"
namespace Dune { namespace Dune {
...@@ -33,7 +35,7 @@ private: ...@@ -33,7 +35,7 @@ private:
std::map<std::string, pybind11::module> modules_; std::map<std::string, pybind11::module> modules_;
}; // class ScopedInterpreter }; // class ScopedInterpreter
ScopedInterpreter &GlobalInterpreter(); DUNE_EXPORT ScopedInterpreter &GlobalInterpreter();
} // namespace PybindXI } // namespace PybindXI
} // namespace Dune } // namespace Dune
......
...@@ -177,6 +177,7 @@ SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}") ...@@ -177,6 +177,7 @@ SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
dune_register_package_flags( dune_register_package_flags(
INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS}
LIBRARIES ${PYTHON_LIBRARIES} LIBRARIES ${PYTHON_LIBRARIES}
COMPILE_OPTIONS -fvisibility-inlines-hidden -fvisibility=hidden
) )
find_package_message(PYTHON find_package_message(PYTHON
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment