Skip to content

Commit

Permalink
cmake: use custom command+target for glibc copying
Browse files Browse the repository at this point in the history
  • Loading branch information
fw-immunant committed Dec 11, 2024
1 parent 39af37a commit 8deb152
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions runtime/libia2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,19 @@ if (LIBIA2_AARCH64)
${SYSROOT_SRC_DIR}/include/*/*.h
${SYSROOT_SRC_DIR}/include/*/*/*.h)
string(REGEX REPLACE ${SYSROOT_SRC_DIR} ${SYSROOT_BIN_DIR} ${SYSROOT_HEADERS_SRC} SYSROOT_HEADERS)
add_custom_target(glibc
BYPRODUCTS
add_custom_command(
OUTPUT
${SYSROOT_BIN_DIR}/lib/libc.so.6
${SYSROOT_BIN_DIR}/lib/ld-linux-aarch64.so.1
${SYSROOT_HEADERS}
COMMAND ${CMAKE_COMMAND} -E copy ${SYSROOT_SRC_DIR}/lib/libc.so.6 ${SYSROOT_BIN_DIR}/lib/
COMMAND ${CMAKE_COMMAND} -E copy ${SYSROOT_SRC_DIR}/lib/ld-linux-aarch64.so.1 ${SYSROOT_BIN_DIR}/lib/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${SYSROOT_SRC_DIR}/include ${SYSROOT_BIN_DIR}/include
COMMENT "Copying glibc prebuilts to sysroot")
COMMENT "Copying glibc prebuilts to sysroot"
)
add_custom_target(glibc
DEPENDS ${SYSROOT_BIN_DIR}/lib/libc.so.6 ${SYSROOT_BIN_DIR}/lib/ld-linux-aarch64.so.1 ${SYSROOT_HEADERS}
)
endif()
set(LIBC_PATH ${SYSROOT_BIN_DIR}/lib/libc.so.6)
else()
Expand Down

0 comments on commit 8deb152

Please sign in to comment.