diff --git a/CMakeLists.txt b/CMakeLists.txt index e98a428..7b44a02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,11 +18,12 @@ target_include_directories(startup PUBLIC env include) add_subdirectory(libwrap) -add_library(bsp INTERFACE) -target_link_libraries(bsp INTERFACE startup wrap) -target_include_directories(bsp INTERFACE env/${BOARD_BASE}) +add_library(bsp STATIC env/${BOARD_BASE}/init.c) +target_link_libraries(bsp PUBLIC startup wrap) +target_include_directories(bsp PUBLIC env/${BOARD_BASE}) target_link_options(bsp INTERFACE LINKER:--no-warn-rwx-segments -nostartfiles -T ${CMAKE_CURRENT_SOURCE_DIR}/env/${BOARD_BASE}/link.lds) + if(SEMIHOSTING) - target_include_directories(bsp INTERFACE /include) + target_include_directories(bsp INTERFACE include) target_sources(bsp INTERFACE env/semihosting.c env/trap.c) endif()