-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplatformConfig.cmake
More file actions
93 lines (89 loc) · 3.42 KB
/
Copy pathplatformConfig.cmake
File metadata and controls
93 lines (89 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
if(WIN32)
set(PLATFORM_TOOLCHAIN_SUFFIX ".exe")
endif()
if("${LN_ARCH}" STREQUAL "RISCV") # RISCV
if(${LN_MCU} STREQUAL "CH32V3x") # ----------CH32V307
# SET(PLATFORM_PREFIX riscv-none-embed-) # MRS toolchain
if(WIN32)
set(PLATFORM_TOOLCHAIN_PATH todo_todo) # Use /c/foo or c:\foo depending if you use mingw cmake or win32 cmake
else()
# --- GCC ---------
set(GCC_OPTIM "-msave-restore")
set(PLATFORM_TOOLCHAIN_PATH
"/riscv/xpack-14.2.0-2/bin"
CACHE INTERNAL "")
if(USE_HW_FPU)
set(PLATFORM_C_FLAGS
"-march=rv32imafc_zicsr -mabi=ilp32f ${GCC_OPTIM}"
CACHE INTERNAL "")
else()
set(PLATFORM_C_FLAGS
"-march=rv32imac_zicsr -mabi=ilp32 ${GCC_OPTIM}"
CACHE INTERNAL "")
endif()
set(PLATFORM_PREFIX
"riscv-none-elf-"
CACHE INTERNAL "")
# FOR CLANG
set(PLATFORM_TOOLCHAIN_TRIPLET
"riscv-none-elf-"
CACHE INTERNAL "")
# -- CLANG -- No FPU SET(PLATFORM_CLANG_PATH "/riscv/tools_llvm/bin" CACHE INTERNAL "")
if(TRUE)
set(PLATFORM_CLANG_PATH
"/riscv/llvm_21.1.8/bin"
CACHE INTERNAL "")
set(PLATFORM_CLANG_VERSION "-21")
else()
set(PLATFORM_CLANG_PATH
"/riscv/21/bin"
CACHE INTERNAL "")
set(PLATFORM_CLANG_VERSION "-21")
endif()
if(USE_HW_FPU)
# SET(PLATFORM_CLANG_SYSROOT "${PLATFORM_CLANG_PATH}/../lib/clang-runtimes/riscv32-none-eabi/riscv32_hard_fp/"
# CACHE INTERNAL "")
set(PLATFORM_CLANG_SYSROOT
"${PLATFORM_CLANG_PATH}/../lib/clang-runtimes/riscv32-unknown-elf/riscv32_hard_fp/"
CACHE INTERNAL "")
set(PLATFORM_CLANG_C_FLAGS
"--target=riscv32 -march=rv32imafc_zicsr -mabi=ilp32f -I${PLATFORM_CLANG_PATH}/../include "
CACHE INTERNAL "")
else()
# SET(PLATFORM_CLANG_SYSROOT "${PLATFORM_CLANG_PATH}/../lib/clang-runtimes/riscv32-none-eabi/riscv32_soft_nofp/"
# CACHE INTERNAL "")
set(PLATFORM_CLANG_SYSROOT
"${PLATFORM_CLANG_PATH}/../lib/clang-runtimes/riscv32-unknown-elf/riscv32_soft_nofp/"
CACHE INTERNAL "")
set(PLATFORM_CLANG_C_FLAGS
"--target=riscv32 -march=rv32imac_zicsr -mabi=ilp32 -I${PLATFORM_CLANG_PATH}/../include"
CACHE INTERNAL "")
endif()
endif()
else() # ----------- GD32VF103
set(PLATFORM_PREFIX riscv32-unknown-elf-)
set(PLATFORM_C_FLAGS "-march=rv32imac -mabi=ilp32 ")
if(WIN32)
set(PLATFORM_TOOLCHAIN_PATH /c/gd32/toolchain/bin/) # Use /c/foo or c:\foo depending if you use mingw cmake or
# win32 cmake
else()
set(PLATFORM_TOOLCHAIN_PATH /opt/gd32/toolchain/bin/)
endif()
endif()
else()
set(PLATFORM_PREFIX arm-none-eabi-)
set(PLATFORM_C_FLAGS " ")
if(WIN32)
set(PLATFORM_TOOLCHAIN_PATH "/c/dev/arm83/bin")
else()
# /arm/arm_llvm_21.1.1/lib/clang-runtimes/arm-none-eabi SET(PLATFORM_CLANG_PATH /arm/arm_llvm_21.1.1/bin)
# SET(PLATFORM_CLANG_VERSION "-21")
set(PLATFORM_CLANG_PATH /arm/llvm_21.1/bin)
set(PLATFORM_CLANG_VERSION "-21")
# SET(PLATFORM_CLANG_PATH /opt/llvm_arm/14/bin) SET(PLATFORM_CLANG_VERSION "")
set(PLATFORM_TOOLCHAIN_PATH "/arm/14.2/bin/")
set(PICO_SDK_PATH
/opt/pico/pico-sdk
CACHE INTERNAL "") # For PICO2040
endif()
endif()