From a9b7348b4b813f0691db9903c6c5d2774cd7ac48 Mon Sep 17 00:00:00 2001 From: Arie Gurfinkel Date: Thu, 4 Aug 2022 14:26:19 -0400 Subject: [PATCH] (cmake): fix visibility on shell z3 binary Commit #b361226 changed symbol visibility from a global to a local option. This creates inconsistency for shell that is compiled as an executable rather than as z3 component. This commit adds same local options to shell target in cmake. Prior to the fix, clang on OSX complains with lots of warnings about symbol visibility being different in different translation units that are linked together --- src/shell/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/shell/CMakeLists.txt b/src/shell/CMakeLists.txt index d55626d05..d9b74f162 100644 --- a/src/shell/CMakeLists.txt +++ b/src/shell/CMakeLists.txt @@ -34,6 +34,14 @@ add_executable(shell # we don't want (I think). ${shell_object_files} ) + +set_target_properties(shell PROPERTIES + # Position independent code needed in shared libraries + POSITION_INDEPENDENT_CODE ON + # Symbol visibility + CXX_VISIBILITY_PRESET hidden + VISIBILITY_INLINES_HIDDEN ON) + z3_add_install_tactic_rule(${shell_deps}) z3_add_memory_initializer_rule(${shell_deps}) z3_add_gparams_register_modules_rule(${shell_deps})