2021-12-24 23:43:51 +01:00
|
|
|
set(CMAKE_SYSTEM_NAME Generic)
|
|
|
|
set(CMAKE_SYSTEM_PROCESSOR arm)
|
2021-12-24 23:43:36 +01:00
|
|
|
|
|
|
|
# Some default GCC settings
|
2021-12-24 23:43:51 +01:00
|
|
|
# arm-none-eabi- must be part of path environment
|
|
|
|
set(TOOLCHAIN_PREFIX arm-none-eabi-)
|
|
|
|
set(FLAGS "-fdata-sections -ffunction-sections --specs=nano.specs -Wl,--gc-sections")
|
|
|
|
set(CPP_FLAGS "-fno-rtti -fno-exceptions -fno-threadsafe-statics")
|
2021-12-24 23:43:36 +01:00
|
|
|
|
2021-12-24 23:43:51 +01:00
|
|
|
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc ${FLAGS})
|
|
|
|
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
|
|
|
|
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++ ${FLAGS} ${CPP_FLAGS})
|
|
|
|
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
|
|
|
|
set(CMAKE_SIZE ${TOOLCHAIN_PREFIX}size)
|
2021-12-24 23:43:36 +01:00
|
|
|
|
|
|
|
set(CMAKE_EXECUTABLE_SUFFIX_ASM ".elf")
|
|
|
|
set(CMAKE_EXECUTABLE_SUFFIX_C ".elf")
|
|
|
|
set(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf")
|
|
|
|
|
|
|
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|