set(CMAKE_SYSTEM Generic)
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)

set(CMAKE_CROSSCOMPILING ON)
set(CMAKE_C_COMPILER_WORKS ON)
set(CMAKE_CXX_COMPILER_WORKS ON)

set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_ASM-ATT_COMPILER arm-none-eabi-as)
set(CMAKE_C_FLAGS "-mthumb -mcpu=cortex-m3")
set(CMAKE_EXE_LINKER_FLAGS "--specs=nano.specs --specs=rdimon.specs -T${PROJECT_SOURCE_DIR}/stm32_flash.ld")
