diff options
| author | hathach <[email protected]> | 2023-05-19 14:46:39 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2023-05-19 14:46:39 +0700 |
| commit | e8dd200fed6adeebd98ebc7abf09d45285da7abf (patch) | |
| tree | 755ac5331dc325dc6b8298c9cac4c92e3877f6f6 /examples | |
| parent | 6ecd4800061ac72421bf3e33468ee670c2d9ae55 (diff) | |
move cmake folder to tools/
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/cmake/cpu/cortex-m33.cmake | 12 | ||||
| -rw-r--r-- | examples/cmake/cpu/cortex-m4.cmake | 12 | ||||
| -rw-r--r-- | examples/cmake/cpu/cortex-m7.cmake | 12 | ||||
| -rw-r--r-- | examples/cmake/toolchain/arm_gcc.cmake | 60 | ||||
| -rw-r--r-- | examples/cmake/toolchain/set_flags.cmake | 24 |
5 files changed, 0 insertions, 120 deletions
diff --git a/examples/cmake/cpu/cortex-m33.cmake b/examples/cmake/cpu/cortex-m33.cmake deleted file mode 100644 index fbd5027b1..000000000 --- a/examples/cmake/cpu/cortex-m33.cmake +++ /dev/null @@ -1,12 +0,0 @@ -if (TOOLCHAIN STREQUAL "gcc") - list(APPEND TOOLCHAIN_COMMON_FLAGS - -mthumb - -mcpu=cortex-m33 - -mfloat-abi=hard - -mfpu=fpv5-d16 - ) - - set(FREERTOS_PORT GCC_ARM_CM33_NONSECURE CACHE INTERNAL "") -else () - # TODO support IAR -endif () diff --git a/examples/cmake/cpu/cortex-m4.cmake b/examples/cmake/cpu/cortex-m4.cmake deleted file mode 100644 index 5a2d16c05..000000000 --- a/examples/cmake/cpu/cortex-m4.cmake +++ /dev/null @@ -1,12 +0,0 @@ -if (TOOLCHAIN STREQUAL "gcc") - list(APPEND TOOLCHAIN_COMMON_FLAGS - -mthumb - -mcpu=cortex-m4 - -mfloat-abi=hard - -mfpu=fpv4-sp-d16 - ) - - set(FREERTOS_PORT GCC_ARM_CM4F CACHE INTERNAL "") -else () - # TODO support IAR -endif () diff --git a/examples/cmake/cpu/cortex-m7.cmake b/examples/cmake/cpu/cortex-m7.cmake deleted file mode 100644 index 481c86bc5..000000000 --- a/examples/cmake/cpu/cortex-m7.cmake +++ /dev/null @@ -1,12 +0,0 @@ -if (TOOLCHAIN STREQUAL "gcc") - list(APPEND TOOLCHAIN_COMMON_FLAGS - -mthumb - -mcpu=cortex-m7 - -mfloat-abi=hard - -mfpu=fpv5-d16 - ) - - set(FREERTOS_PORT GCC_ARM_CM7 CACHE INTERNAL "") -else () - # TODO support IAR -endif () diff --git a/examples/cmake/toolchain/arm_gcc.cmake b/examples/cmake/toolchain/arm_gcc.cmake deleted file mode 100644 index c7b6cff98..000000000 --- a/examples/cmake/toolchain/arm_gcc.cmake +++ /dev/null @@ -1,60 +0,0 @@ -set(CMAKE_SYSTEM_NAME Generic) - -set(CMAKE_ASM_COMPILER "arm-none-eabi-gcc") -set(CMAKE_C_COMPILER "arm-none-eabi-gcc") -set(CMAKE_CXX_COMPILER "arm-none-eabi-g++") -set(GCC_ELF2BIN "arm-none-eabi-objcopy") -set_property(GLOBAL PROPERTY ELF2BIN ${GCC_ELF2BIN}) - -# Look for includes and libraries only in the target system prefix. -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - -# pass TOOLCHAIN_CPU to -set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_SYSTEM_PROCESSOR) - -include(${CMAKE_CURRENT_LIST_DIR}/../cpu/${CMAKE_SYSTEM_PROCESSOR}.cmake) - -# enable all possible warnings for building examples -list(APPEND TOOLCHAIN_COMMON_FLAGS - -fdata-sections - -ffunction-sections - -fsingle-precision-constant - -fno-strict-aliasing - ) - -list(APPEND TOOLCHAIN_EXE_LINKER_FLAGS - -Wl,--print-memory-usage - -Wl,--gc-sections - -Wl,--cref - ) - -list(APPEND TOOLCHAIN_WARNING_FLAGS - -Wall - -Wextra - -Werror - -Wfatal-errors - -Wdouble-promotion - -Wstrict-prototypes - -Wstrict-overflow - -Werror-implicit-function-declaration - -Wfloat-equal - -Wundef - -Wshadow - -Wwrite-strings - -Wsign-compare - -Wmissing-format-attribute - -Wunreachable-code - -Wcast-align - -Wcast-function-type - -Wcast-qual - -Wnull-dereference - -Wuninitialized - -Wunused - -Wreturn-type - -Wredundant-decls - ) - -include(${CMAKE_CURRENT_LIST_DIR}/set_flags.cmake) diff --git a/examples/cmake/toolchain/set_flags.cmake b/examples/cmake/toolchain/set_flags.cmake deleted file mode 100644 index 3f109b59e..000000000 --- a/examples/cmake/toolchain/set_flags.cmake +++ /dev/null @@ -1,24 +0,0 @@ -include(CMakePrintHelpers) -foreach(LANG IN ITEMS C CXX ASM) - # join the toolchain flags into a single string - list(APPEND TOOLCHAIN_${LANG}_FLAGS ${TOOLCHAIN_COMMON_FLAGS}) - list(JOIN TOOLCHAIN_${LANG}_FLAGS " " TOOLCHAIN_${LANG}_FLAGS) - set(CMAKE_${LANG}_FLAGS_INIT "${TOOLCHAIN_${LANG}_FLAGS}") - - #cmake_print_variables(CMAKE_${LANG}_FLAGS_INIT) - - # optimization flags - set(CMAKE_${LANG}_FLAGS_RELEASE_INIT "-Os") - set(CMAKE_${LANG}_FLAGS_DEBUG_INIT "-O0") -endforeach() - -# Linker -list(JOIN TOOLCHAIN_EXE_LINKER_FLAGS " " CMAKE_EXE_LINKER_FLAGS_INIT) - -# try_compile is cmake test compiling its own example, -# pass -nostdlib to skip stdlib linking -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") -endif() |
