This repository was archived by the owner on Jan 6, 2025. It is now read-only.
File tree 1 file changed +9
-1
lines changed
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
48
48
"make the build fail on any warnings during compilation, or linking" ON )
49
49
option (EXPECT_SPURIOUS_SYSCALLS
50
50
"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
+
51
53
find_program (CTAGS ctags)
52
54
if (CTAGS)
53
55
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)
138
140
set_target_properties (syscall_intercept_base_c
139
141
PROPERTIES C_VISIBILITY_PRESET hidden)
140
142
143
+ set (CAPSTONE_LINK_MODE "-Bdynamic" )
144
+ if (STATIC_CAPSTONE)
145
+ set (CAPSTONE_LINK_MODE "-Bstatic" )
146
+ endif ()
147
+
141
148
target_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"
143
151
"-Wl,--version-script=${CMAKE_SOURCE_DIR} /version.map" )
144
152
145
153
target_link_libraries (syscall_intercept_static
You can’t perform that action at this time.
0 commit comments