Add option to use default symbol visiblity for VTK-m libraries.

VTK doesn't hide symbols for static builds, which results in linker
errors for VTK targets that link with VTK-m. This option allows VTK-m
to match VTK's behavior.
This commit is contained in:
Allison Vacanti 2017-11-07 12:50:06 -05:00
parent 3f608450cd
commit 5f1db422cd

@ -101,9 +101,13 @@ set(CMAKE_CXX_EXTENSIONS False)
# 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. In practice we will try to not export
# symbols for any third party library
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
# symbols for any third party library.
option(VTKm_USE_DEFAULT_SYMBOL_VISIBILITY "Don't explicitly hide symbols from libraries." OFF)
mark_as_advanced(VTKm_USE_DEFAULT_SYMBOL_VISIBILITY)
if(NOT VTKm_USE_DEFAULT_SYMBOL_VISIBILITY)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
endif()
include(GenerateExportHeader)
include(CMake/VTKmCompilerExtras.cmake)