From d1ebd3bd806f4b4e1f74703f682ca64994c79a28 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 14 Nov 2024 02:19:09 -0700 Subject: Get a good, basic framework for ISRs and properly handle the data sections. --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 09a39d9..792547f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) include(cmake/fiddle.cmake) -project (ch537) +project (ch537 LANGUAGES C ASM) # Configure for Bare Metal. set(CMAKE_SYSTEM_NAME Generic) @@ -12,9 +12,11 @@ set(CMAKE_SYSTEM_PROCESSOR riscv32) set(TC_PREFIX riscv32-unknown-elf-) include_directories(include linker ${CMAKE_BINARY_DIR}/generated/fdl) -file(GLOB SOURCES "src/*.c" "src/*.s") +file(GLOB_RECURSE SOURCES "src/*.c" "src/*.s") file(GLOB LINKER_SCRIPT "linker/*.ld") +message("Sources ${SOURCES}") + file(REAL_PATH "ch-flash/" CH_FLASH_DIR) # Set compiler and tools @@ -24,7 +26,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Set compiler and linker flags -set(CMAKE_C_FLAGS "-ffreestanding -march=rv32imac -mabi=ilp32 -lgcc -static -nostartfiles -O -std=gnu99" CACHE INTERNAL "C Compiler options") +set(CMAKE_C_FLAGS "-ffreestanding -march=rv32imac_zicsr -mabi=ilp32 -lgcc -static -nostartfiles -O -std=gnu99" CACHE INTERNAL "C Compiler options") +set(CMAKE_ASM_FLAGS "-ffreestanding -march=rv32imac_zicsr -mabi=ilp32 -lgcc -static -nostartfiles -O -std=gnu99" CACHE INTERNAL "C Compiler options") set(CMAKE_EXE_LINKER_FLAGS "--xref -static -T ${LINKER_SCRIPT}" CACHE INTERNAL "Linker options") # Add executable with custom linking commands -- cgit