Add -fvisibility=hidden to GCC/Clang compiler flags

This commit is contained in:
Tim Angus 2025-08-22 18:46:21 +01:00
parent 3aee97dfab
commit 9d2227cf5c

View File

@ -24,6 +24,10 @@ add_compile_options(-Wno-format-zero-length -Wno-format-nonliteral)
# that rely on the compiler not optimising them away, so disable it
add_compile_options(-fno-strict-aliasing)
# This is necessary to hide all symbols unless explicitly exported
# via the Q_EXPORT macro
add_compile_options(-fvisibility=hidden)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /opt/quake3)
endif()