RVSCC/fw/cmake/toolchain.cmake

18 lines
504 B
CMake
Raw Normal View History

2022-12-04 08:55:47 +00:00
set(CMAKE_SYSTEM_NAME Generic)
2023-01-30 04:41:58 +00:00
find_program(RISCV_GCC_FOUND
NAMES riscv-none-elf-gcc riscv32-unknown-linux-gnu-gcc)
get_filename_component(GCC_BIN ${RISCV_GCC_FOUND} NAME)
message("msg gcc: ${GCC_BIN}")
string(REPLACE gcc "" TOOLCHAIN_PREFIX ${GCC_BIN})
message("msg toolchain: ${TOOLCHAIN_PREFIX}")
2022-12-04 08:55:47 +00:00
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)
2022-12-24 00:30:12 +00:00
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump)