blob: a39a69bc3062279beba9112cae5c1ecfabda9e56 [file] [log] [blame]
Boris Deletic08f48962020-10-28 12:42:58 +00001#-------------------------------------------------------------------------------
2# Copyright (c) 2020, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8if (NOT TFM_PARTITION_EXAMPLE)
9 return()
10endif()
11
12cmake_minimum_required(VERSION 3.15)
13cmake_policy(SET CMP0079 NEW)
14
15add_library(tfm_partition_example STATIC)
16
17target_sources(tfm_partition_example
18 PRIVATE
19 tfm_example_partition.c
20)
21
22target_include_directories(tfm_partition_example
23 PRIVATE
24 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
25 ${CMAKE_BINARY_DIR}/generated/secure_fw/partitions/example_partition
26)
27
28target_link_libraries(tfm_partition_example
29 PRIVATE
30 tfm_secure_api
31 psa_interface
32 platform_s
33)
34
35############################ Secure API ########################################
36
37target_sources(tfm_secure_api
38 PRIVATE
39 ${CMAKE_CURRENT_SOURCE_DIR}/tfm_example_partition_secure_api.c
40)
41
42# The veneers give warnings about not being properly declared so they get hidden
43# to not overshadow _real_ warnings.
44set_source_files_properties(tfm_example_partition_secure_api.c
45 PROPERTIES
46 COMPILE_FLAGS -Wno-implicit-function-declaration
47)
48
49############################ Partition Defs ####################################
50
51target_link_libraries(tfm_partitions
52 INTERFACE
53 tfm_partition_example
54)
55
56target_compile_definitions(tfm_partition_defs
57 INTERFACE
58 TFM_PARTITION_EXAMPLE
59)