2024-12-17 12:32:21 +01:00
|
|
|
project(libwrap)
|
2024-02-26 20:41:15 +01:00
|
|
|
|
2024-12-17 12:32:21 +01:00
|
|
|
message(STATUS " here 2 in libwrap")
|
|
|
|
|
|
|
|
# Create object library for libwrap
|
|
|
|
set(LIB_SOURCES
|
|
|
|
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
|
|
|
|
# Standard library
|
|
|
|
stdlib/malloc.c
|
|
|
|
# Miscellaneous
|
|
|
|
misc/write_hex.c
|
|
|
|
)
|
|
|
|
|
|
|
|
if(SEMIHOSTING)
|
|
|
|
list(APPEND LIB_SOURCES
|
|
|
|
semihosting/semihosting.c
|
|
|
|
semihosting/trap.c )
|
|
|
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(${PROJECT_NAME} OBJECT ${LIB_SOURCES})
|
|
|
|
|
|
|
|
|
|
|
|
# Include directories
|
|
|
|
target_include_directories(${PROJECT_NAME} PRIVATE
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${BSP_BASE}/include
|
|
|
|
include/
|
|
|
|
${BSP_BASE}/env
|
|
|
|
${BSP_BASE}/env/${BOARD}
|
|
|
|
${BSP_BASE}/drivers
|
2024-02-26 20:41:15 +01:00
|
|
|
)
|
|
|
|
|
2024-12-17 12:32:21 +01:00
|
|
|
# Compile options
|
2024-02-26 20:41:15 +01:00
|
|
|
|
2024-12-17 12:32:21 +01:00
|
|
|
#link global_compile_options to this libraries
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE global_compile_options)
|
2024-02-26 20:41:15 +01:00
|
|
|
|
2024-12-17 12:32:21 +01:00
|
|
|
# Compile definitions
|
|
|
|
#target_compile_definitions(libwrap_objects PRIVATE
|
|
|
|
# BOARD_${BOARD}
|
|
|
|
#)
|
2024-02-26 20:41:15 +01:00
|
|
|
|
2024-12-17 12:32:21 +01:00
|
|
|
# Export objects to parent scope
|
|
|
|
set(LIBWRAP_OBJECTS $<TARGET_OBJECTS:${PROJECT_NAME}> PARENT_SCOPE)
|