CMake: Set visibility flags with add_cxx_compile_options() helper

This makes the flags not break Swift builds
This commit is contained in:
Andrew Kaster 2025-07-09 11:34:13 -06:00 committed by Andrew Kaster
commit a0b902cca1
Notes: github-actions[bot] 2025-07-09 22:28:13 +00:00

View file

@ -5,7 +5,7 @@ function(lagom_generate_export_header name fs_name)
# to export symbols required by external consumers. This allows the codebase
# to gradually slowly migrate instead of an all-or-nothing approach.
if (NOT WIN32)
target_compile_options(${name} PRIVATE -fvisibility=hidden)
add_cxx_compile_options(${name} PRIVATE -fvisibility=hidden)
else()
set_target_properties(${name} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS OFF)
endif()