From 1eee0f973db8e3cee7e7588e167ece73f86bf823 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 2 Oct 2018 09:29:40 -0700 Subject: [PATCH] build: give BlocksRuntime hidden visibility Since BlocksRuntime is currently built statically, we should ensure that it does not leak symbols into the target library or executable it is being linked into. This will require consumers to explicitly link against the BlocksRuntime. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c6b3afba..0e6e34bd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,7 +142,9 @@ if(NOT BlocksRuntime_FOUND) ${PROJECT_SOURCE_DIR}/src/BlocksRuntime/runtime.c) set_target_properties(BlocksRuntime PROPERTIES - POSITION_INDEPENDENT_CODE TRUE) + POSITION_INDEPENDENT_CODE TRUE + C_VISIBILITY_PRESET HIDDEN + VISIBILITY_INLINES_HIDDEN YES) if(HAVE_OBJC AND CMAKE_DL_LIBS) set_target_properties(BlocksRuntime PROPERTIES