CMakeLists.txt: use visibility=hidden by default, so that unneeded libtownengine.so symbols are not leaked

This commit is contained in:
veclav talica 2024-10-13 19:03:29 +03:00
parent ef5d609f4a
commit 9329d3c2be
2 changed files with 2 additions and 1 deletions

View File

@ -305,6 +305,7 @@ link_deps(twn_third_parties)
give_options(${TWN_TARGET}) give_options(${TWN_TARGET})
include_deps(${TWN_TARGET}) include_deps(${TWN_TARGET})
link_deps(${TWN_TARGET}) link_deps(${TWN_TARGET})
target_compile_options(${TWN_TARGET} PRIVATE -fvisibility=hidden)
target_link_libraries(${TWN_TARGET} PUBLIC twn_third_parties) target_link_libraries(${TWN_TARGET} PUBLIC twn_third_parties)
target_include_directories(${TWN_TARGET} PRIVATE ${TWN_ROOT_DIR}/src) target_include_directories(${TWN_TARGET} PRIVATE ${TWN_ROOT_DIR}/src)

View File

@ -4,7 +4,7 @@
#if defined(__WIN32) #if defined(__WIN32)
#define TWN_API __declspec(dllexport) #define TWN_API __declspec(dllexport)
#else #else
#define TWN_API #define TWN_API __attribute__((visibility("default")))
#endif #endif
#endif #endif