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##
18##
19## STM32L1 target specific CMake file
20##
21
22if(NOT DEFINED LINKER_SCRIPT)
23message(FATAL_ERROR "No linker script defined")
24endif(NOT DEFINED LINKER_SCRIPT)
25message("Linker script: ${LINKER_SCRIPT}")
26
27
28#---------------------------------------------------------------------------------------
29# Set compiler/linker flags
30#---------------------------------------------------------------------------------------
31
32# Object build options
33set(OBJECT_GEN_FLAGS "-Og -g -mthumb -g2 -fno-builtin -mcpu=cortex-m3 -Wall -Wextra -pedantic -Wno-unused-parameter -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize")
34
35set(CMAKE_C_FLAGS "${OBJECT_GEN_FLAGS} -std=gnu99 " CACHE INTERNAL "C Compiler options")
36set(CMAKE_CXX_FLAGS "${OBJECT_GEN_FLAGS} -std=c++11 " CACHE INTERNAL "C++ Compiler options")
37set(CMAKE_ASM_FLAGS "${OBJECT_GEN_FLAGS} -x assembler-with-cpp " CACHE INTERNAL "ASM Compiler options")
38
39# Linker flags
40set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections --specs=nano.specs --specs=nosys.specs -mthumb -g2 -mcpu=cortex-m3 -mabi=aapcs -T${LINKER_SCRIPT} -Wl,-Map=${CMAKE_PROJECT_NAME}.map" CACHE INTERNAL "Linker options")
41