1##
2##   ______                              _
3##  / _____)             _              | |
4## ( (____  _____ ____ _| |_ _____  ____| |__
5##  \____ \| ___ |    (_   _) ___ |/ ___)  _ \
6##  _____) ) ____| | | || |_| ____( (___| | | |
7## (______/|_____)_|_|_| \__)_____)\____)_| |_|
8## (C)2013-2017 Semtech
9##  ___ _____ _   ___ _  _____ ___  ___  ___ ___
10## / __|_   _/_\ / __| |/ / __/ _ \| _ \/ __| __|
11## \__ \ | |/ _ \ (__| ' <| _| (_) |   / (__| _|
12## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___|
13## embedded.connectivity.solutions.==============
14##
15## License:  Revised BSD License, see LICENSE.TXT file included in the project
16## Authors:  Johannes Bruder ( STACKFORCE ), Miguel Luis ( Semtech ),
17##           Marten Lootsma(TWTG) on behalf of Microchip/Atmel (c)2017
18##
19##
20## SAMR34 target specific CMake file
21##
22
23if(NOT DEFINED LINKER_SCRIPT)
24message(FATAL_ERROR "No linker script defined")
25endif(NOT DEFINED LINKER_SCRIPT)
26message("Linker script: ${LINKER_SCRIPT}")
27
28
29#---------------------------------------------------------------------------------------
30# Set compiler/linker flags
31#---------------------------------------------------------------------------------------
32
33# Object build options
34set(OBJECT_GEN_FLAGS "-Og -g -mthumb -g2 -fno-builtin -mcpu=cortex-m0plus -Wall  -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize -mlong-calls")
35
36set(CMAKE_C_FLAGS "${OBJECT_GEN_FLAGS} -std=gnu99 " CACHE INTERNAL "C Compiler options")
37set(CMAKE_CXX_FLAGS "${OBJECT_GEN_FLAGS} -std=c++11 " CACHE INTERNAL "C++ Compiler options")
38set(CMAKE_ASM_FLAGS "${OBJECT_GEN_FLAGS} -x assembler-with-cpp " CACHE INTERNAL "ASM Compiler options")
39
40# Linker flags
41set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections --specs=nano.specs --specs=nosys.specs -mthumb -g2 -mcpu=cortex-m0plus -mabi=aapcs -T${LINKER_SCRIPT} -Wl,-Map=${CMAKE_PROJECT_NAME}.map" CACHE INTERNAL "Linker options")
42