Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit e7dfb66

Browse files
Merge pull request #49 from GBuella/cmake_fix
CMake: add target generate_syscall_intercept_scoped
2 parents 6fbb015 + 6783052 commit e7dfb66

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

CMakeLists.txt

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,29 @@ add_library(syscall_intercept_unscoped STATIC
103103
set(syscall_intercept_unscoped_a $<TARGET_FILE:syscall_intercept_unscoped>)
104104

105105
add_custom_command(
106-
OUTPUT syscall_intercept_scoped.o
106+
OUTPUT syscall_intercept_unscoped.o
107107
COMMAND ${CMAKE_LINKER}
108108
-r --whole-archive ${syscall_intercept_unscoped_a}
109-
-o syscall_intercept_scoped.o
110-
COMMAND ${CMAKE_OBJCOPY} --localize-hidden syscall_intercept_scoped.o
111-
COMMENT "Hiding symbols")
109+
-o syscall_intercept_unscoped.o
110+
DEPENDS syscall_intercept_unscoped)
111+
112+
add_custom_command(
113+
OUTPUT syscall_intercept_scoped.o
114+
COMMAND ${CMAKE_OBJCOPY}
115+
--localize-hidden
116+
syscall_intercept_unscoped.o
117+
syscall_intercept_scoped.o
118+
DEPENDS syscall_intercept_unscoped.o)
119+
120+
add_custom_target(generate_syscall_intercept_scoped
121+
DEPENDS syscall_intercept_scoped.o)
112122

113123
add_library(syscall_intercept_shared SHARED syscall_intercept_scoped.o)
114124
add_library(syscall_intercept_static STATIC syscall_intercept_scoped.o)
115125

126+
add_dependencies(syscall_intercept_shared generate_syscall_intercept_scoped)
127+
add_dependencies(syscall_intercept_static generate_syscall_intercept_scoped)
128+
116129
set_target_properties(syscall_intercept_base_c
117130
PROPERTIES C_VISIBILITY_PRESET hidden)
118131

0 commit comments

Comments
 (0)