set(CMAKE_SYSTEM_NAME Generic)
set(BUILD_SHARED_LIBS OFF)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)

set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)

string(REPLACE ";" " " COMPILE_FLAGS "${COMPILE_FLAGS_${DEVICE}}")
string(REPLACE ";" " " LINK_FLAGS "${LINK_FLAGS_${DEVICE}}")
message(STATUS "Device: ${DEVICE}")

set(CMAKE_C_FLAGS_INIT ${COMPILE_FLAGS})
set(CMAKE_CXX_FLAGS_INIT ${COMPILE_FLAGS})
set(CMAKE_ASM_FLAGS_INIT ${COMPILE_FLAGS})
set(CMAKE_EXE_LINKER_FLAGS_INIT ${LINK_FLAGS})
set(CMAKE_EXECUTABLE_SUFFIX elf)
