mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Redo visibility fallback
This commit is contained in:
parent
bea58bf8bb
commit
5a1ef7e4a6
@ -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
|
# 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.
|
# the configuration step so that we don't have to also provide an override.
|
||||||
if (BUILD_SHARED_LIBS)
|
if (BUILD_SHARED_LIBS)
|
||||||
get_target_property(_VisPreset Catch2 CXX_VISIBILITY_PRESET)
|
if (MSVC)
|
||||||
get_target_property(_ExportAll Catch2 WINDOWS_EXPORT_ALL_SYMBOLS)
|
set_target_properties(Catch2 Catch2WithMain
|
||||||
if (MSVC AND NOT _ExportAll
|
PROPERTIES
|
||||||
OR _VisPreset STREQUAL "hidden")
|
WINDOWS_EXPORT_ALL_SYMBOLS ON
|
||||||
|
|
||||||
message(WARNING
|
|
||||||
"Catch2 does not support being built as a dynamic library with hidden"
|
|
||||||
" visibility. You have to ensure that visibility is handled yourself."
|
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
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()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user