From 9329d3c2be2bbd903e808fdbf46c879bdb6f8a86 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Sun, 13 Oct 2024 19:03:29 +0300 Subject: [PATCH] CMakeLists.txt: use visibility=hidden by default, so that unneeded libtownengine.so symbols are not leaked --- CMakeLists.txt | 1 + include/twn_engine_api.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 44bcedf..5aa1fea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -305,6 +305,7 @@ link_deps(twn_third_parties) give_options(${TWN_TARGET}) include_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_include_directories(${TWN_TARGET} PRIVATE ${TWN_ROOT_DIR}/src) diff --git a/include/twn_engine_api.h b/include/twn_engine_api.h index adbeffd..72db8b0 100644 --- a/include/twn_engine_api.h +++ b/include/twn_engine_api.h @@ -4,7 +4,7 @@ #if defined(__WIN32) #define TWN_API __declspec(dllexport) #else - #define TWN_API + #define TWN_API __attribute__((visibility("default"))) #endif #endif