File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ # Toolchain settings
2+ set (CMAKE_C_COMPILER riscv32-unknown-elf-gcc)
3+ set (CMAKE_CXX_COMPILER riscv32-unknown-elf-g++)
4+ set (AS riscv32-unknown-elf-as)
5+ set (AR riscv32-unknown-elf-ar)
6+ set (OBJCOPY riscv32-unknown-elf-objcopy)
7+ set (OBJDUMP riscv32-unknown-elf-objdump)
8+ set (SIZE riscv32-unknown-elf-size)
9+
10+ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
11+ set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
12+ set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
13+ set (CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
14+
15+ # this makes the test compiles use static library option so that we don't need to pre-set linker flags and scripts
16+ set (CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
17+
18+ set (CMAKE_C_FLAGS "${CFLAGS} " CACHE INTERNAL "c compiler flags" )
19+ set (CMAKE_CXX_FLAGS "${CXXFLAGS} " CACHE INTERNAL "cxx compiler flags" )
20+ set (CMAKE_ASM_FLAGS "${ASFLAGS} -D__ASSEMBLER__ -D__riscv_float_abi_single" CACHE INTERNAL "asm compiler flags" )
21+ set (CMAKE_EXE_LINKER_FLAGS "${LDFLAGS} " CACHE INTERNAL "exe link flags" )
22+
23+ SET (CMAKE_C_FLAGS_DEBUG "-Og -g -ggdb3" CACHE INTERNAL "c debug compiler flags" )
24+ SET (CMAKE_CXX_FLAGS_DEBUG "-Og -g -ggdb3" CACHE INTERNAL "cxx debug compiler flags" )
25+ SET (CMAKE_ASM_FLAGS_DEBUG "-g -ggdb3" CACHE INTERNAL "asm debug compiler flags" )
26+
27+ SET (CMAKE_C_FLAGS_RELEASE "-O3" CACHE INTERNAL "c release compiler flags" )
28+ SET (CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE INTERNAL "cxx release compiler flags" )
29+ SET (CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm release compiler flags" )
Original file line number Diff line number Diff line change 1+ # Name of the target
2+ set (CMAKE_SYSTEM_NAME Generic)
3+ set (CMAKE_SYSTEM_PROCESSOR risc-v32)
4+
5+ set (THREADX_ARCH "risc-v32" )
6+ set (THREADX_TOOLCHAIN "gnu" )
7+ set (ARCH_FLAGS "-g -march=rv32gc -mabi=ilp32d -mcmodel=medany" )
8+ set (CFLAGS "${ARCH_FLAGS} " )
9+ set (ASFLAGS "${ARCH_FLAGS} " )
10+ set (LDFLAGS "${ARCH_FLAGS} " )
11+
12+ include (${CMAKE_CURRENT_LIST_DIR} /riscv32-unknown-elf.cmake)
You can’t perform that action at this time.
0 commit comments