From dd01e7ed22cea652061f0d12cecf929e04b285e9 Mon Sep 17 00:00:00 2001 From: Oxore Date: Sun, 5 Mar 2023 18:28:08 +0300 Subject: Restructure toolchain file --- .gitignore | 2 +- CMakeLists.txt | 2 ++ toolchain-gcc-newlib-arm-none-eabi-cm0.cmake | 15 --------------- toolchain-gcc-newlib.cmake | 13 +++++++++++++ 4 files changed, 16 insertions(+), 16 deletions(-) delete mode 100644 toolchain-gcc-newlib-arm-none-eabi-cm0.cmake create mode 100644 toolchain-gcc-newlib.cmake diff --git a/.gitignore b/.gitignore index b2b872b..40e8986 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ /Project/EWARM/*.ewt /Project/EWARM/*.eww compile_commands.json -cmake[-_]build/ +cmake[-_]build*/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 40efc3b..35881c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer") set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer") +set(cpu_options -mthumb -mcpu=cortex-m0 -msoft-float) set(nixie_clock_sources "Libraries/Indicate/indicate_modes_task.c" "Libraries/TouchSense/stmCriticalSection.c" @@ -105,6 +106,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE target_compile_definitions(${PROJECT_NAME} PRIVATE STM32F0XX=1 LED_DRIVER=1 + __FREERTOS__=1 ) # select linker script diff --git a/toolchain-gcc-newlib-arm-none-eabi-cm0.cmake b/toolchain-gcc-newlib-arm-none-eabi-cm0.cmake deleted file mode 100644 index 36b0405..0000000 --- a/toolchain-gcc-newlib-arm-none-eabi-cm0.cmake +++ /dev/null @@ -1,15 +0,0 @@ -set(CMAKE_SYSTEM_NAME Generic) -set(CMAKE_SYSTEM_VERSION 1) -set(CMAKE_SYSTEM_PROCESSOR ARM) -set(CMAKE_C_COMPILER_WORKS 1) # mitigate missing `_exit` -set(CMAKE_CXX_COMPILER_WORKS 1) # mitigate missing `_exit` -set(TOOLCHAIN_NAME "gcc-newlib") -set(CMAKE_C_COMPILER "arm-none-eabi-gcc") -set(CMAKE_ASM_COMPILER "arm-none-eabi-gcc") -set(CMAKE_CXX_COMPILER "arm-none-eabi-g++") -set(CMAKE_LINKER "arm-none-eabi-gcc") -set(CMAKE_CXX_LINK_EXECUTABLE " -o ") -set(CMAKE_OBJCOPY "arm-none-eabi-objcopy") -set(CMAKE_OBJSIZE "arm-none-eabi-size") -set(cpu_options -mthumb -mcpu=cortex-m0 -msoft-float) -add_compile_definitions("__FREERTOS__") diff --git a/toolchain-gcc-newlib.cmake b/toolchain-gcc-newlib.cmake new file mode 100644 index 0000000..0599b34 --- /dev/null +++ b/toolchain-gcc-newlib.cmake @@ -0,0 +1,13 @@ +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_PROCESSOR ARM) +set(CMAKE_C_COMPILER_WORKS 1) # mitigate missing `_exit` +set(CMAKE_CXX_COMPILER_WORKS 1) # mitigate missing `_exit` +set(TOOLCHAIN_NAME "gcc-newlib") +set(CMAKE_C_COMPILER "arm-none-eabi-gcc") +set(CMAKE_ASM_COMPILER "arm-none-eabi-gcc") +set(CMAKE_CXX_COMPILER "arm-none-eabi-g++") +set(CMAKE_LINKER "arm-none-eabi-gcc") +set(CMAKE_CXX_LINK_EXECUTABLE " -o ") +set(CMAKE_OBJCOPY "arm-none-eabi-objcopy") +set(CMAKE_OBJSIZE "arm-none-eabi-size") -- cgit v1.2.3