Skip to content

Commit 3076086

Browse files
committed
Do not export symbols by default
This hides LLVM symbols (when linked statically), preventing conflicts with system LLVM (loaded by the OpenGL implementation).
1 parent b961157 commit 3076086

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ target_sources(scratchcpp
8282

8383
include(FetchContent)
8484

85+
# Compiler options
86+
target_compile_options(scratchcpp PRIVATE
87+
-fvisibility=hidden
88+
-fvisibility-inlines-hidden
89+
)
90+
91+
target_link_options(scratchcpp PRIVATE
92+
-Wl,--exclude-libs,ALL
93+
-Wl,-Bsymbolic
94+
)
95+
8596
# zip
8697
include(build/zip.cmake)
8798
target_link_libraries(scratchcpp PRIVATE zip)

0 commit comments

Comments
 (0)