40 lines
758 B
CMake
40 lines
758 B
CMake
|
project(bsp_env)
|
||
|
message(STATUS " here in bsp_env")
|
||
|
# Enable ASM language
|
||
|
enable_language(ASM)
|
||
|
set(LIB_SOURCES
|
||
|
entry.S
|
||
|
start.S
|
||
|
)
|
||
|
|
||
|
# Set ASM compile options
|
||
|
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -march=${RISCV_ARCH}_zicsr_zifencei -mabi=${RISCV_ABI}")
|
||
|
|
||
|
|
||
|
add_library(asm_obj OBJECT ${LIB_SOURCES})
|
||
|
add_subdirectory(${BOARD})
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
# Include the ISS board configuration
|
||
|
set(ISS_SOURCE_DIR "${CMAKE_SOURCE_DIR}/bare-metal-bsp/env/iss")
|
||
|
set(ISS_BINARY_DIR "${CMAKE_BINARY_DIR}/iss_build")
|
||
|
|
||
|
add_subdirectory(${ISS_SOURCE_DIR} ${ISS_BINARY_DIR})
|
||
|
|
||
|
|
||
|
|
||
|
# Export variables for hello-world to use
|
||
|
set(ENV_OBJECTS
|
||
|
$<TARGET_OBJECTS:env_entry>
|
||
|
$<TARGET_OBJECTS:env_start>
|
||
|
PARENT_SCOPE
|
||
|
)
|
||
|
|
||
|
# Export board library
|
||
|
set(BOARD_LIB board_iss PARENT_SCOPE)
|