Skip to content

Commit

Permalink
(cmake): fix visibility on shell z3 binary
Browse files Browse the repository at this point in the history
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
  • Loading branch information
agurfinkel authored and NikolajBjorner committed Aug 5, 2022
1 parent 78a0f57 commit a9b7348
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/shell/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit a9b7348

Please sign in to comment.