This repository was archived by the owner on Jan 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ option(TREAT_WARNINGS_AS_ERRORS
4848 "make the build fail on any warnings during compilation, or linking" ON )
4949option (EXPECT_SPURIOUS_SYSCALLS
5050 "account for some unexpected syscalls in tests - enable while using sanitizers, gcov" OFF )
51+ option (STATIC_CAPSTONE "statically link libcapstone into the shared library" OFF )
52+
5153find_program (CTAGS ctags)
5254if (CTAGS)
5355 option (AUTO_RUN_CTAGS "create tags file every on every rebuild" ON )
@@ -138,8 +140,14 @@ add_dependencies(syscall_intercept_static generate_syscall_intercept_scoped)
138140set_target_properties (syscall_intercept_base_c
139141 PROPERTIES C_VISIBILITY_PRESET hidden)
140142
143+ set (CAPSTONE_LINK_MODE "-Bdynamic" )
144+ if (STATIC_CAPSTONE)
145+ set (CAPSTONE_LINK_MODE "-Bstatic" )
146+ endif ()
147+
141148target_link_libraries (syscall_intercept_shared
142- PRIVATE ${CMAKE_DL_LIBS} ${capstone_LIBRARIES}
149+ PRIVATE ${CMAKE_DL_LIBS}
150+ "-Wl,--push-state,${CAPSTONE_LINK_MODE} -lcapstone -Wl,--pop-state"
143151 "-Wl,--version-script=${CMAKE_SOURCE_DIR} /version.map" )
144152
145153target_link_libraries (syscall_intercept_static
You can’t perform that action at this time.
0 commit comments