From da84208d891e0b522c24dedc0d9564a87587471b Mon Sep 17 00:00:00 2001 From: mio Date: Mon, 29 Apr 2024 11:55:06 +0800 Subject: [PATCH] Hide symbols for unicorn-common --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2cffc0fc83..71d7c92289 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,11 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.15") cmake_policy(SET CMP0092 NEW) endif() +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.3") + # Honor visibility properties for all target types. + cmake_policy(SET CMP0063 NEW) +endif() + option(ZIG_BUILD "Enable zig build" OFF) if(ZIG_BUILD) include(cmake/zig.cmake) @@ -1196,6 +1201,11 @@ add_library(unicorn-common STATIC ${UNICORN_COMMON_SRCS} ) +set_target_properties(unicorn-common + PROPERTIES + C_VISIBILITY_PRESET + hidden) + if(NOT MSVC AND NOT ANDROID_ABI) target_link_libraries(unicorn-common PRIVATE pthread) endif()