diff --git a/cmake/compilers/gnu.cmake b/cmake/compilers/gnu.cmake index 22238f44..a6c9f934 100644 --- a/cmake/compilers/gnu.cmake +++ b/cmake/compilers/gnu.cmake @@ -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()