2025-01-06 20:19:05 +01:00
|
|
|
include(CMakePrintHelpers)
|
2024-12-17 12:32:21 +01:00
|
|
|
set(LIB_SOURCES
|
2025-01-06 20:19:05 +01:00
|
|
|
sys/_exit.c
|
|
|
|
sys/close.c
|
|
|
|
sys/execve.c
|
|
|
|
sys/fork.c
|
|
|
|
sys/fstat.c
|
|
|
|
sys/getpid.c
|
|
|
|
sys/isatty.c
|
|
|
|
sys/kill.c
|
|
|
|
sys/link.c
|
|
|
|
sys/lseek.c
|
|
|
|
sys/open.c
|
|
|
|
sys/openat.c
|
|
|
|
sys/printf.c
|
|
|
|
sys/puts.c
|
|
|
|
sys/read.c
|
|
|
|
sys/sbrk.c
|
|
|
|
sys/stat.c
|
|
|
|
sys/times.c
|
|
|
|
sys/unlink.c
|
|
|
|
sys/wait.c
|
|
|
|
sys/write.c
|
2024-12-17 12:32:21 +01:00
|
|
|
# Standard library
|
|
|
|
stdlib/malloc.c
|
|
|
|
# Miscellaneous
|
|
|
|
misc/write_hex.c
|
2025-01-16 11:09:20 +01:00
|
|
|
)
|
2025-01-06 20:19:05 +01:00
|
|
|
set(WRAP_ARGS "")
|
|
|
|
foreach(FILE ${LIB_SOURCES})
|
|
|
|
get_filename_component(DIR ${FILE} DIRECTORY)
|
2025-01-16 11:09:20 +01:00
|
|
|
if(NOT DIR STREQUAL "misc")
|
2025-01-06 20:19:05 +01:00
|
|
|
get_filename_component(BASE_NAME ${FILE} NAME_WE)
|
|
|
|
list(APPEND WRAP_ARGS "LINKER:--wrap=${BASE_NAME}")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_library(wrap STATIC ${LIB_SOURCES} ../env/${BOARD_BASE}/bsp_write.c ../env/${BOARD_BASE}/bsp_read.c)
|
|
|
|
target_link_options(wrap INTERFACE ${WRAP_ARGS})
|
2024-12-17 12:32:21 +01:00
|
|
|
|