diff options
| author | Martin Hořeňovský | 2022-06-27 13:10:22 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2022-06-27 13:10:22 +0200 |
| commit | 5a1ef7e4a6caf3d5f696eb82302e3d87ff5c2303 (patch) | |
| tree | d378c8f37733a51a2fc320b0c6570f834db26e0a /src | |
| parent | bea58bf8bbfca887f871c3aa2d720ba62c01f855 (diff) | |
| download | catch3-5a1ef7e4a6caf3d5f696eb82302e3d87ff5c2303.tar.gz | |
Redo visibility fallback
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 57978ecb..2aa67b8f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -435,14 +435,21 @@ set(CATCH_WARNING_TARGETS ${CATCH_WARNING_TARGETS} PARENT_SCOPE) # so we want to check & warn users if they do this. However, we won't abort # the configuration step so that we don't have to also provide an override. if (BUILD_SHARED_LIBS) - get_target_property(_VisPreset Catch2 CXX_VISIBILITY_PRESET) - get_target_property(_ExportAll Catch2 WINDOWS_EXPORT_ALL_SYMBOLS) - if (MSVC AND NOT _ExportAll - OR _VisPreset STREQUAL "hidden") + if (MSVC) + set_target_properties(Catch2 Catch2WithMain + PROPERTIES + WINDOWS_EXPORT_ALL_SYMBOLS ON + ) + endif() - message(WARNING - "Catch2 does not support being built as a dynamic library with hidden" - " visibility. You have to ensure that visibility is handled yourself." + get_target_property(_VisPreset Catch2 CXX_VISIBILITY_PRESET) + if (NOT MSVC AND _VisPreset STREQUAL "hidden") + set_target_properties(Catch2 Catch2WithMain + PROPERTIES + CXX_VISIBILITY_PRESET "default" + VISIBILITY_INLINES_HIDDEN OFF ) + message(WARNING "Setting Catch2's visibility to default." + " Hidden visibility is not supported.") endif() endif() |