|
| 1 | +############################################################################## |
| 2 | +# Copyright Christopher Kormanyos 2021 - 2026. |
| 3 | +# Distributed under the Boost Software License, |
| 4 | +# Version 1.0. (See accompanying file LICENSE_1_0.txt |
| 5 | +# or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 6 | + |
| 7 | +# |
| 8 | +# MIT License |
| 9 | +# |
| 10 | +# Copyright (c) 2019 Joel Winarske |
| 11 | +# |
| 12 | +# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 13 | +# of this software and associated documentation files (the "Software"), to deal |
| 14 | +# in the Software without restriction, including without limitation the rights |
| 15 | +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 16 | +# copies of the Software, and to permit persons to whom the Software is |
| 17 | +# furnished to do so, subject to the following conditions: |
| 18 | +# |
| 19 | +# The above copyright notice and this permission notice shall be included in all |
| 20 | +# copies or substantial portions of the Software. |
| 21 | +# |
| 22 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 23 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 24 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 25 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 26 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 27 | +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 28 | +# SOFTWARE. |
| 29 | +# |
| 30 | + |
| 31 | +set(APP ref_app) |
| 32 | + |
| 33 | +set(CMAKE_EXECUTABLE_SUFFIX .elf) |
| 34 | + |
| 35 | +set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 36 | +set(CMAKE_CXX_STANDARD 14) |
| 37 | + |
| 38 | +set(TARGET_INCLUDES |
| 39 | + ${PATH_APP}/util/STL |
| 40 | +) |
| 41 | + |
| 42 | +set(_TARGET_CFLAGS |
| 43 | + -finline-functions |
| 44 | + -finline-limit=32 |
| 45 | + -mcpu=cortex-m4 |
| 46 | + -mtune=cortex-m4 |
| 47 | + -mthumb |
| 48 | + -mfloat-abi=hard |
| 49 | + -mfpu=fpv4-sp-d16 |
| 50 | + -ffast-math |
| 51 | + -mno-unaligned-access |
| 52 | + -mno-long-calls |
| 53 | +) |
| 54 | + |
| 55 | +set(TARGET_AFLAGS "") |
| 56 | + |
| 57 | +set(_TARGET_LDFLAGS |
| 58 | + -nostdlib |
| 59 | + -nostartfiles |
| 60 | + -T ${LINKER_DEFINITION_FILE} |
| 61 | +) |
| 62 | + |
| 63 | +string(REPLACE ";" " " TARGET_CFLAGS "${_TARGET_CFLAGS}") |
| 64 | +string(REPLACE ";" " " TARGET_LDFLAGS "${_TARGET_LDFLAGS}") |
| 65 | + |
| 66 | + |
| 67 | +set(FILES_TARGET |
| 68 | + ${PATH_APP}/mcal/mcal_gcc_cxx_completion |
| 69 | + ${PATH_TGT}/startup/crt0 |
| 70 | + ${PATH_TGT}/startup/crt0_init_ram |
| 71 | + ${PATH_TGT}/startup/crt1 |
| 72 | + ${PATH_TGT}/startup/int_vect |
| 73 | +) |
0 commit comments