diff options
| author | hathach <[email protected]> | 2026-03-13 23:07:46 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-03-13 23:07:46 +0700 |
| commit | e2ead60107ce2e1324c7578fcee98efb8f0c5975 (patch) | |
| tree | 0b1e79f1c984ef9224f7bf22c2618b3bf9090bd6 /examples | |
| parent | adf853643b3db80444da5c3018eb214e244fcf47 (diff) | |
add ft9xx-gcc toolchain support to CI
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/build_system/cmake/cpu/ft32.cmake | 13 | ||||
| -rw-r--r-- | examples/build_system/cmake/cpu/rx610.cmake | 12 | ||||
| -rw-r--r-- | examples/build_system/cmake/cpu/rx64m.cmake | 12 | ||||
| -rw-r--r-- | examples/build_system/cmake/toolchain/ft32_gcc.cmake | 22 | ||||
| -rw-r--r-- | examples/build_system/cmake/toolchain/rx_gcc.cmake | 26 |
5 files changed, 85 insertions, 0 deletions
diff --git a/examples/build_system/cmake/cpu/ft32.cmake b/examples/build_system/cmake/cpu/ft32.cmake new file mode 100644 index 000000000..13153e555 --- /dev/null +++ b/examples/build_system/cmake/cpu/ft32.cmake @@ -0,0 +1,13 @@ +if (TOOLCHAIN STREQUAL "gcc") + set(TOOLCHAIN_COMMON_FLAGS + -fvar-tracking + -fvar-tracking-assignments + ) + +elseif (TOOLCHAIN STREQUAL "clang") + message(FATAL_ERROR "Clang is not supported for this target") + +elseif (TOOLCHAIN STREQUAL "iar") + message(FATAL_ERROR "IAR is not supported for this target") + +endif () diff --git a/examples/build_system/cmake/cpu/rx610.cmake b/examples/build_system/cmake/cpu/rx610.cmake new file mode 100644 index 000000000..6f535275d --- /dev/null +++ b/examples/build_system/cmake/cpu/rx610.cmake @@ -0,0 +1,12 @@ +if (NOT DEFINED TOOLCHAIN OR TOOLCHAIN STREQUAL "gcc") + set(TOOLCHAIN_COMMON_FLAGS + -mcpu=rx610 + -misa=v1 + -mlittle-endian-data + -fshort-enums + ) + set(FREERTOS_PORT GCC_RX600 CACHE INTERNAL "") + +else () + message(FATAL_ERROR "Toolchain ${TOOLCHAIN} is not supported for RX") +endif () diff --git a/examples/build_system/cmake/cpu/rx64m.cmake b/examples/build_system/cmake/cpu/rx64m.cmake new file mode 100644 index 000000000..2b106ea00 --- /dev/null +++ b/examples/build_system/cmake/cpu/rx64m.cmake @@ -0,0 +1,12 @@ +if (NOT DEFINED TOOLCHAIN OR TOOLCHAIN STREQUAL "gcc") + set(TOOLCHAIN_COMMON_FLAGS + -mcpu=rx64m + -misa=v2 + -mlittle-endian-data + -fshort-enums + ) + set(FREERTOS_PORT GCC_RX600 CACHE INTERNAL "") + +else () + message(FATAL_ERROR "Toolchain ${TOOLCHAIN} is not supported for RX") +endif () diff --git a/examples/build_system/cmake/toolchain/ft32_gcc.cmake b/examples/build_system/cmake/toolchain/ft32_gcc.cmake new file mode 100644 index 000000000..edf8048ab --- /dev/null +++ b/examples/build_system/cmake/toolchain/ft32_gcc.cmake @@ -0,0 +1,22 @@ +if (NOT DEFINED CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER "ft32-elf-gcc") +endif () + +if (NOT DEFINED CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER "ft32-elf-g++") +endif () + +set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) + +find_program(CMAKE_SIZE ft32-elf-size) +find_program(CMAKE_OBJCOPY ft32-elf-objcopy) +find_program(CMAKE_OBJDUMP ft32-elf-objdump) + +include(${CMAKE_CURRENT_LIST_DIR}/common.cmake) + +get_property(IS_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE) +if (IS_IN_TRY_COMPILE) + set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -nostdlib") + set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -nostdlib") + cmake_print_variables(CMAKE_C_LINK_FLAGS) +endif () diff --git a/examples/build_system/cmake/toolchain/rx_gcc.cmake b/examples/build_system/cmake/toolchain/rx_gcc.cmake new file mode 100644 index 000000000..3f8e3662e --- /dev/null +++ b/examples/build_system/cmake/toolchain/rx_gcc.cmake @@ -0,0 +1,26 @@ +# Cross Compiler for RX +if (NOT DEFINED CROSS_COMPILE) + set(CROSS_COMPILE "rx-elf-") +endif () + +if (NOT DEFINED CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER ${CROSS_COMPILE}gcc) +endif () + +if (NOT DEFINED CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER ${CROSS_COMPILE}g++) +endif () + +set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) +find_program(CMAKE_SIZE ${CROSS_COMPILE}size) +find_program(CMAKE_OBJCOPY ${CROSS_COMPILE}objcopy) +find_program(CMAKE_OBJDUMP ${CROSS_COMPILE}objdump) + +include(${CMAKE_CURRENT_LIST_DIR}/common.cmake) + +get_property(IS_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE) +if (IS_IN_TRY_COMPILE) + set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -nostdlib") + set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -nostdlib") + cmake_print_variables(CMAKE_C_LINK_FLAGS) +endif () |
