blob: 4d710fb03d9ff80a9bbb0af10806414f954bc45f [file] [log] [blame]
Soby Mathewb4c6df42022-11-09 11:13:29 +00001#
2# SPDX-License-Identifier: BSD-3-Clause
3# SPDX-FileCopyrightText: Copyright TF-RMM Contributors.
4#
5
6include_guard()
7
8set(CMAKE_SYSTEM_NAME "Generic")
9set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
10set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
11set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
12set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
13
14foreach(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 ")
22endforeach()
23
24string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--gc-sections ")