Commit afc19ab0 authored by Robert Maynard's avatar Robert Maynard

Setup symbol visibility controls for VTK-m

parent 37a2359c
......@@ -66,9 +66,6 @@ target_include_directories(vtkm_compiler_flags INTERFACE
$<INSTALL_INTERFACE:include>
)
# Todo set up PIC flags here
#INTERFACE_POSITION_INDEPENDENT_CODE
# Additional warnings just for Clang 3.5+, and AppleClang 7+ we specify
# for all build types, since these failures to vectorize are not limited
# to developer builds
......
......@@ -57,7 +57,7 @@ else()
endif()
set(VTKm_BUILD_SHARED_LIBS "@BUILD_SHARED_LIBS@")
set(VTKm_BUILD_SHARED_LIBS "@VTKm_BUILD_SHARED_LIBS@")
set(VTKm_ENABLE_CUDA "@VTKm_ENABLE_CUDA@")
set(VTKm_ENABLE_TBB "@VTKm_ENABLE_TBB@")
set(VTKm_ENABLE_RENDERING "@VTKm_ENABLE_RENDERING@")
......
......@@ -153,9 +153,13 @@ function(vtkm_library)
${VTKm_LIB_WRAP_FOR_CUDA}
)
set_target_properties(${lib_name}
PROPERTIES
CXX_VISIBILITY_PRESET "hidden")
if(VTKm_USE_DEFAULT_SYMBOL_VISIBILITY)
set_target_properties(${lib_name}
PROPERTIES
CUDA_VISIBILITY_PRESET "hidden"
CXX_VISIBILITY_PRESET "hidden")
endif()
vtkm_generate_export_header(${lib_name})
install(TARGETS ${lib_name}
......
......@@ -80,15 +80,20 @@ option(VTKm_ENABLE_MPI "Enable MPI support" OFF)
option(VTKm_ENABLE_DOCUMENTATION "Build Doxygen documentation" OFF)
option(VTKm_ENABLE_EXAMPLES "Build examples" OFF)
option(VTKm_USE_DOUBLE_PRECISION
"Use double precision for floating point calculations"
OFF
)
option(VTKm_USE_DOUBLE_PRECISION "Use double precision for floating point calculations" OFF)
option(VTKm_USE_64BIT_IDS "Use 64-bit indices." ON)
option(VTKm_NO_ASSERT "Disable assertions in debugging builds." OFF)
mark_as_advanced(VTKm_NO_ASSERT)
# VTK-m is setup by default not to export symbols unless explicitly stated.
# We prefer to only export symbols of a small set of user facing classes,
# rather than exporting all symbols. This flag is added so that consumers
# which require static builds can force all symbols on, which is something
# VTK does.
option(VTKm_USE_DEFAULT_SYMBOL_VISIBILITY "Don't explicitly hide symbols from libraries." OFF)
mark_as_advanced(VTKm_USE_DEFAULT_SYMBOL_VISIBILITY)
option(BUILD_SHARED_LIBS "Build VTK-m with shared libraries" ON)
set(VTKm_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
......@@ -112,6 +117,10 @@ include(VTKmCompilerFlags)
include(VTKmWrappers)
include(VTKmCPUVectorization)
#-----------------------------------------------------------------------------
# When building VTK-m it self we want to explicitly disable compiler extensions
set(CMAKE_CXX_EXTENSIONS OFF)
if (VTKm_ENABLE_TESTING)
enable_testing()
include(CTest)
......
......@@ -46,7 +46,4 @@ target_compile_options(vtkm_cont_cuda PRIVATE $<TARGET_PROPERTY:vtkm_cont,INTERF
target_compile_definitions(vtkm_cont_cuda PRIVATE $<TARGET_PROPERTY:vtkm_cont,INTERFACE_COMPILE_DEFINITIONS>)
target_compile_features(vtkm_cont_cuda PRIVATE $<TARGET_PROPERTY:vtkm_cont,INTERFACE_COMPILE_FEATURES>)
target_include_directories(vtkm_cont_cuda PRIVATE $<TARGET_PROPERTY:vtkm_cont,INTERFACE_INCLUDE_DIRECTORIES>)
if(BUILD_SHARED_LIBS)
set_property(TARGET vtkm_cont_cuda PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
set_property(TARGET vtkm_cont_cuda PROPERTY POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS})
......@@ -35,7 +35,4 @@ target_compile_options(vtkm_cont_serial PRIVATE $<TARGET_PROPERTY:vtkm_cont,INTE
target_compile_definitions(vtkm_cont_serial PRIVATE $<TARGET_PROPERTY:vtkm_cont,INTERFACE_COMPILE_DEFINITIONS>)
target_compile_features(vtkm_cont_serial PRIVATE $<TARGET_PROPERTY:vtkm_cont,INTERFACE_COMPILE_FEATURES>)
target_include_directories(vtkm_cont_serial PRIVATE $<TARGET_PROPERTY:vtkm_cont,INTERFACE_INCLUDE_DIRECTORIES>)
if(BUILD_SHARED_LIBS)
set_property(TARGET vtkm_cont_serial PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
set_property(TARGET vtkm_cont_serial PROPERTY POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS})
......@@ -51,7 +51,4 @@ target_compile_options(vtkm_cont_tbb PRIVATE $<TARGET_PROPERTY:vtkm_cont,INTERFA
target_compile_definitions(vtkm_cont_tbb PRIVATE $<TARGET_PROPERTY:vtkm_cont,INTERFACE_COMPILE_DEFINITIONS>)
target_compile_features(vtkm_cont_tbb PRIVATE $<TARGET_PROPERTY:vtkm_cont,INTERFACE_COMPILE_FEATURES>)
target_include_directories(vtkm_cont_tbb PRIVATE $<TARGET_PROPERTY:vtkm_cont,INTERFACE_INCLUDE_DIRECTORIES>)
if(BUILD_SHARED_LIBS)
set_property(TARGET vtkm_cont_tbb PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
set_property(TARGET vtkm_cont_tbb PROPERTY POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment