Soby Mathew | b4c6df4 | 2022-11-09 11:13:29 +0000 | [diff] [blame] | 1 | # |
| 2 | # SPDX-License-Identifier: BSD-3-Clause |
| 3 | # SPDX-FileCopyrightText: Copyright TF-RMM Contributors. |
| 4 | # |
| 5 | |
| 6 | include_guard() |
| 7 | |
| 8 | set(CMAKE_SYSTEM_NAME "Generic") |
| 9 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) |
| 10 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) |
| 11 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
| 12 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) |
| 13 | |
| 14 | foreach(language IN ITEMS ASM C) |
| 15 | string(APPEND CMAKE_${language}_FLAGS_INIT "-fno-common ") |
| 16 | string(APPEND CMAKE_${language}_FLAGS_INIT "-fomit-frame-pointer ") |
| 17 | string(APPEND CMAKE_${language}_FLAGS_INIT "-ffunction-sections ") |
| 18 | string(APPEND CMAKE_${language}_FLAGS_INIT "-fdata-sections ") |
| 19 | string(APPEND CMAKE_${language}_FLAGS_INIT "-Wall -Werror ") |
| 20 | string(APPEND CMAKE_${language}_FLAGS_DEBUG_INIT "-Og ") |
| 21 | string(APPEND CMAKE_${language}_FLAGS_RELEASE_INIT "-g ") |
| 22 | endforeach() |
| 23 | |
| 24 | string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--gc-sections ") |