RVSCC/cmake/riscv-toolchain.cmake
Mario1159 4785dd29de
Some checks failed
Verilate / verilate (push) Failing after 51s
Add Git LFS
2023-06-06 14:22:41 +00:00

15 lines
465 B
CMake
Executable File

set(CMAKE_SYSTEM_NAME Generic)
find_program(RISCV_GCC_FOUND
NAMES riscv-none-elf-gcc riscv32-unknown-elf-gcc)
get_filename_component(GCC_BIN ${RISCV_GCC_FOUND} NAME)
string(REPLACE gcc "" TOOLCHAIN_PREFIX ${GCC_BIN})
set(CMAKE_ASM_COMPILER ${TOOLCHAIN_PREFIX}as)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump)