set(CMAKE_SYSTEM_NAME "Generic")
set(CMAKE_SYSTEM_PROCESSOR "ARM")
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
set(data_flags "-ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums")
set(warning_flags "-Wall -Wno-attributes -Wno-format")
set(CMAKE_C_FLAGS_INIT "--std=gnu99 ${warning_flags} ${data_flags}")
if(NOT CMAKE_C_COMPILER MATCHES "arm-none-eabi-gcc$")
    set(CMAKE_C_COMPILER arm-none-eabi-gcc)
endif()
if(NOT CMAKE_CXX_COMPILER MATCHES "arm-none-eabi-c\\+\\+$")
    set(CMAKE_CXX_COMPILER arm-none-eabi-c++)
endif()
