cmake: llvm: riscv: Set RISC-V flags when building with clang
Ensure --target and -march/-mabi/-mcmodel are set appropriately when building with clang targeting RISC-V. Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
This commit is contained in:
parent
8ec839f76c
commit
ba871733e0
2 changed files with 8 additions and 0 deletions
|
@ -31,6 +31,8 @@ if(NOT "${ARCH}" STREQUAL "posix")
|
|||
)
|
||||
|
||||
include(${ZEPHYR_BASE}/cmake/compiler/clang/target_arm.cmake)
|
||||
elseif("${ARCH}" STREQUAL "riscv")
|
||||
include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_riscv.cmake)
|
||||
endif()
|
||||
|
||||
if(DEFINED CMAKE_C_COMPILER_TARGET)
|
||||
|
|
|
@ -33,6 +33,12 @@ elseif("${ARCH}" STREQUAL "x86")
|
|||
else()
|
||||
set(triple i686-pc-none-elf)
|
||||
endif()
|
||||
elseif("${ARCH}" STREQUAL "riscv")
|
||||
if(CONFIG_64BIT)
|
||||
set(triple riscv64-unknown-elf)
|
||||
else()
|
||||
set(triple riscv32-unknown-elf)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED triple)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue