blob: fb61f81ad597799978b6121412a458a7b632e6f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#-------------------------------------------------------------------------------
# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
#-------------------------------------------------------------------------------
cmake_minimum_required(VERSION 3.7)
#Tell cmake where our modules can be found
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../cmake)
#Some project global settings
set (INITIAL_ATTESTATION_DIR "${CMAKE_CURRENT_LIST_DIR}")
get_filename_component(TFM_ROOT_DIR "${INITIAL_ATTESTATION_DIR}/../../.." ABSOLUTE)
#Include common stuff to control cmake.
include("Common/BuildSys")
#Start an embedded project.
embedded_project_start(CONFIG "${TFM_ROOT_DIR}/configs/ConfigDefault.cmake")
project(tfm_attest LANGUAGES ASM C)
embedded_project_fixup()
#Get the definition of what files we need to build
include(CMakeLists.inc)
if (NOT DEFINED TFM_LVL)
message(FATAL_ERROR "Incomplete build configuration: TFM_LVL is undefined.")
endif()
if (NOT TARGET tfm_qcbor_encode)
add_subdirectory(${TFM_ROOT_DIR}/lib/ext/qcbor ${CMAKE_CURRENT_BINARY_DIR}/qcbor)
endif()
if (NOT TARGET tfm_t_cose_sign)
add_subdirectory(${TFM_ROOT_DIR}/lib/ext/t_cose ${CMAKE_CURRENT_BINARY_DIR}/t_cose)
endif()
#Specify what we build (for the initial attestation service, build as a static library)
add_library(tfm_attest STATIC ${ALL_SRC_ASM} ${ALL_SRC_C} $<TARGET_OBJECTS:tfm_qcbor_encode> $<TARGET_OBJECTS:tfm_t_cose_sign>)
embedded_set_target_compile_defines(TARGET tfm_attest LANGUAGE C DEFINES __ARM_FEATURE_CMSE=${ARM_FEATURE_CMSE} __thumb2__ TFM_LVL=${TFM_LVL})
#Set common compiler flags
config_setting_shared_compiler_flags(tfm_attest)
embedded_project_end(tfm_attest)
|