Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
David Hu | 48369db | 2020-12-17 17:31:54 +0800 | [diff] [blame] | 2 | # Copyright (c) 2020-2021, Arm Limited. All rights reserved. |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 8 | cmake_minimum_required(VERSION 3.13) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 9 | project(tfm_ns LANGUAGES ASM C) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 10 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 11 | # For multi-core projects, the NS app can be run on a different CPU to the |
| 12 | # Secure code. To facilitate this, we once again reload the compiler to load the |
| 13 | # setting for the NS CPU. Cmake settings are directory scoped so this affects |
| 14 | # anything loaded from or declared in this dir. |
| 15 | if (TFM_MULTI_CORE_TOPOLOGY) |
| 16 | include(${CMAKE_SOURCE_DIR}/platform/ext/target/${TFM_PLATFORM}/preload_ns.cmake) |
Raef Coles | 34cffa7 | 2020-10-28 10:27:19 +0000 | [diff] [blame] | 17 | tfm_toolchain_reload_compiler() |
David Hu | 402a298 | 2020-12-17 22:31:04 +0800 | [diff] [blame] | 18 | |
| 19 | # Enable TFM_MULTI_CORE_NS_OS when building with tf-m-tests NS App. |
| 20 | set(TFM_MULTI_CORE_NS_OS ON CACHE BOOL "Enable NS RTOS support in NS mailbox") |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 21 | endif() |
| 22 | |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame] | 23 | # In actual NS integration, NS side build should include the source files |
| 24 | # exported by TF-M build. |
| 25 | # Directly include interface folder to simplify the NS build in this demo, since |
| 26 | # install always occurs at the end of build. |
| 27 | set(INTERFACE_SRC_DIR ${CMAKE_SOURCE_DIR}/interface/src) |
| 28 | set(INTERFACE_INC_DIR ${CMAKE_SOURCE_DIR}/interface/include) |
| 29 | |
| 30 | #################### TF-M NS interface (header only) ########################### |
| 31 | |
| 32 | add_library(tfm_ns_interface INTERFACE) |
| 33 | |
| 34 | target_include_directories(tfm_ns_interface |
| 35 | INTERFACE |
| 36 | ${INTERFACE_INC_DIR} |
| 37 | ${CMAKE_BINARY_DIR}/generated/interface/include |
| 38 | ${INTERFACE_INC_DIR}/os_wrapper |
David Hu | 8e68325 | 2020-12-17 18:02:32 +0800 | [diff] [blame] | 39 | $<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:${INTERFACE_INC_DIR}/multi_core> |
David Hu | 98adf32 | 2020-09-01 16:18:46 +0800 | [diff] [blame^] | 40 | $<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:${CMAKE_SOURCE_DIR}/platform/ext/cmsis> |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame] | 41 | ) |
| 42 | |
| 43 | # PSA interface files are generated from a template |
| 44 | add_dependencies(tfm_ns_interface |
| 45 | tfm_generated_files |
| 46 | ) |
| 47 | |
| 48 | # Include selection of Secure Partitions from TF-M build. |
| 49 | # It can be replaced by NS side configurations later. |
| 50 | target_link_libraries(tfm_ns_interface |
| 51 | INTERFACE |
| 52 | tfm_partition_defs |
| 53 | ) |
| 54 | |
| 55 | target_compile_definitions(tfm_ns_interface |
| 56 | INTERFACE |
| 57 | $<$<BOOL:${TFM_PSA_API}>:TFM_PSA_API> |
| 58 | $<$<STREQUAL:${TEST_PSA_API},IPC>:PSA_API_TEST_IPC> |
| 59 | $<$<BOOL:${TFM_NS_CLIENT_IDENTIFICATION}>:TFM_NS_CLIENT_IDENTIFICATION> |
| 60 | $<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:TFM_MULTI_CORE_TOPOLOGY> |
David Hu | 402a298 | 2020-12-17 22:31:04 +0800 | [diff] [blame] | 61 | $<$<BOOL:${TFM_MULTI_CORE_NS_OS}>:TFM_MULTI_CORE_NS_OS> |
David Hu | 98adf32 | 2020-09-01 16:18:46 +0800 | [diff] [blame^] | 62 | $<$<AND:$<BOOL:${TFM_MULTI_CORE_NS_OS_MAILBOX_THREAD}>,$<BOOL:${TFM_MULTI_CORE_NS_OS}>>:TFM_MULTI_CORE_NS_OS_MAILBOX_THREAD> |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame] | 63 | $<$<BOOL:${FORWARD_PROT_MSG}>:FORWARD_PROT_MSG> |
| 64 | ) |
| 65 | |
| 66 | ###################### TF-M NS interface api (NS lib) ########################## |
| 67 | |
| 68 | add_library(tfm_api_ns STATIC) |
| 69 | |
| 70 | target_sources(tfm_api_ns |
| 71 | PRIVATE |
| 72 | $<$<BOOL:${TFM_NS_CLIENT_IDENTIFICATION}>:${INTERFACE_SRC_DIR}/tfm_nspm_svc_handler.c> |
| 73 | $<$<BOOL:${TFM_NS_CLIENT_IDENTIFICATION}>:${INTERFACE_SRC_DIR}/tfm_nspm_api.c> |
| 74 | ) |
| 75 | |
| 76 | if (${TFM_PSA_API}) |
| 77 | target_sources(tfm_api_ns PRIVATE |
| 78 | $<$<OR:$<BOOL:{$FORWARD_PROT_MSG}>,$<BOOL:${TFM_PARTITION_PLATFORM}>>:${INTERFACE_SRC_DIR}/tfm_platform_ipc_api.c> |
| 79 | $<$<OR:$<BOOL:{$FORWARD_PROT_MSG}>,$<BOOL:${TFM_PARTITION_PROTECTED_STORAGE}>>:${INTERFACE_SRC_DIR}/tfm_ps_ipc_api.c> |
| 80 | $<$<OR:$<BOOL:{$FORWARD_PROT_MSG}>,$<BOOL:${TFM_PARTITION_INTERNAL_TRUSTED_STORAGE}>>:${INTERFACE_SRC_DIR}/tfm_its_ipc_api.c> |
| 81 | $<$<OR:$<BOOL:{$FORWARD_PROT_MSG}>,$<BOOL:${TFM_PARTITION_CRYPTO}>>:${INTERFACE_SRC_DIR}/tfm_crypto_ipc_api.c> |
| 82 | $<$<OR:$<BOOL:{$FORWARD_PROT_MSG}>,$<BOOL:${TFM_PARTITION_INITIAL_ATTESTATION}>>:${INTERFACE_SRC_DIR}/tfm_initial_attestation_ipc_api.c> |
| 83 | ) |
| 84 | |
| 85 | if (TFM_MULTI_CORE_TOPOLOGY) |
| 86 | target_sources(tfm_api_ns PRIVATE |
David Hu | 8e68325 | 2020-12-17 18:02:32 +0800 | [diff] [blame] | 87 | ${INTERFACE_SRC_DIR}/multi_core/tfm_multi_core_ns_api.c |
| 88 | ${INTERFACE_SRC_DIR}/multi_core/tfm_multi_core_psa_ns_api.c |
David Hu | 402a298 | 2020-12-17 22:31:04 +0800 | [diff] [blame] | 89 | $<$<BOOL:${TFM_MULTI_CORE_NS_OS}>:${INTERFACE_SRC_DIR}/multi_core/tfm_ns_mailbox_rtos_api.c> |
David Hu | 98adf32 | 2020-09-01 16:18:46 +0800 | [diff] [blame^] | 90 | $<$<NOT:$<BOOL:${TFM_MULTI_CORE_NS_OS_MAILBOX_THREAD}>>:${INTERFACE_SRC_DIR}/multi_core/tfm_ns_mailbox.c> |
| 91 | $<$<AND:$<BOOL:${TFM_MULTI_CORE_NS_OS}>,$<BOOL:${TFM_MULTI_CORE_NS_OS_MAILBOX_THREAD}>>:${INTERFACE_SRC_DIR}/multi_core/tfm_ns_mailbox_thread.c> |
| 92 | $<$<BOOL:${TEST_NS}>:${INTERFACE_SRC_DIR}/multi_core/tfm_ns_mailbox_test.c> |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame] | 93 | ) |
| 94 | else() |
| 95 | target_sources(tfm_api_ns PRIVATE |
| 96 | ${INTERFACE_SRC_DIR}/tfm_ns_interface.c |
| 97 | ${INTERFACE_SRC_DIR}/tfm_psa_ns_api.c |
| 98 | ) |
| 99 | endif() |
| 100 | else() |
| 101 | target_sources(tfm_api_ns PRIVATE |
| 102 | $<$<BOOL:${TFM_PARTITION_PLATFORM}>:${INTERFACE_SRC_DIR}/tfm_platform_func_api.c> |
| 103 | $<$<BOOL:${TFM_PARTITION_AUDIT_LOG}>:${INTERFACE_SRC_DIR}/tfm_audit_func_api.c> |
| 104 | $<$<BOOL:${TFM_PARTITION_PROTECTED_STORAGE}>:${INTERFACE_SRC_DIR}/tfm_ps_func_api.c> |
| 105 | $<$<BOOL:${TFM_PARTITION_INTERNAL_TRUSTED_STORAGE}>:${INTERFACE_SRC_DIR}/tfm_its_func_api.c> |
| 106 | $<$<BOOL:${TFM_PARTITION_CRYPTO}>:${INTERFACE_SRC_DIR}/tfm_crypto_func_api.c> |
| 107 | $<$<BOOL:${TFM_PARTITION_INITIAL_ATTESTATION}>:${INTERFACE_SRC_DIR}/tfm_initial_attestation_func_api.c> |
| 108 | ${INTERFACE_SRC_DIR}/tfm_psa_ns_api.c |
| 109 | ${INTERFACE_SRC_DIR}/tfm_ns_interface.c |
| 110 | ) |
| 111 | endif() |
| 112 | |
| 113 | target_link_libraries(tfm_api_ns |
| 114 | PUBLIC |
| 115 | tfm_ns_interface |
| 116 | PRIVATE |
| 117 | platform_ns |
| 118 | # CMSIS is currently only required to provide the NS client IDs. In |
| 119 | # future, this should probably be made more OS agnostic |
| 120 | $<$<BOOL:${TFM_NS_CLIENT_IDENTIFICATION}>:CMSIS_5_tfm_ns> |
| 121 | ) |
| 122 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 123 | ############################# PSA test integration ############################# |
| 124 | |
Raef Coles | c922f25 | 2020-10-05 10:49:30 +0100 | [diff] [blame] | 125 | if(TEST_PSA_API AND NOT PSA_ARCH_TESTS_BINARY_PATH) |
| 126 | if(NOT SUITE) |
| 127 | set(SUITE ${TEST_PSA_API}) |
| 128 | endif() |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 129 | |
Øyvind Rønningstad | 205a34a | 2020-10-02 10:31:23 +0200 | [diff] [blame] | 130 | if (NOT DEFINED PSA_API_TEST_TARGET) |
| 131 | string(REGEX REPLACE ".*/" "" PSA_API_TEST_TARGET ${TFM_PLATFORM}) |
| 132 | endif() |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 133 | |
Raef Coles | c922f25 | 2020-10-05 10:49:30 +0100 | [diff] [blame] | 134 | if(NOT TARGET) |
| 135 | if (NOT "${TEST_PSA_API}" STREQUAL "IPC") |
| 136 | set(TARGET tgt_dev_apis_tfm_${PSA_API_TEST_TARGET}) |
| 137 | else() |
| 138 | set(TARGET tgt_ff_tfm_${PSA_API_TEST_TARGET}) |
| 139 | endif() |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 140 | endif() |
| 141 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 142 | |
Raef Coles | c922f25 | 2020-10-05 10:49:30 +0100 | [diff] [blame] | 143 | if(NOT PSA_INCLUDE_PATHS) |
David Hu | a1fee3d | 2020-12-30 11:06:37 +0800 | [diff] [blame] | 144 | set(PSA_INCLUDE_PATHS ${INTERFACE_INC_DIR}/ |
Raef Coles | 23d6a19 | 2020-10-22 15:43:38 +0100 | [diff] [blame] | 145 | ${CMAKE_BINARY_DIR}/generated/api-tests/platform/manifests/ |
Raef Coles | c922f25 | 2020-10-05 10:49:30 +0100 | [diff] [blame] | 146 | ${CMAKE_BINARY_DIR}/generated/interface/include |
| 147 | ) |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 148 | endif() |
| 149 | |
Raef Coles | c922f25 | 2020-10-05 10:49:30 +0100 | [diff] [blame] | 150 | if(NOT SP_HEAP_MEM_SUPP) |
Raef Coles | 06e6f65 | 2020-10-20 16:10:38 +0100 | [diff] [blame] | 151 | set(SP_HEAP_MEM_SUPP 0) |
Raef Coles | c922f25 | 2020-10-05 10:49:30 +0100 | [diff] [blame] | 152 | endif() |
| 153 | if(NOT PLATFORM_PSA_ISOLATION_LEVEL) |
| 154 | set(PLATFORM_PSA_ISOLATION_LEVEL ${TFM_ISOLATION_LEVEL}) |
| 155 | endif() |
| 156 | |
| 157 | if (NOT TOOLCHAIN) |
| 158 | if (${CMAKE_C_COMPILER_ID} STREQUAL GNU) |
| 159 | set(TOOLCHAIN GNUARM) |
| 160 | elseif (${CMAKE_C_COMPILER_ID} STREQUAL ARMClang) |
| 161 | set(TOOLCHAIN ARMCLANG) |
| 162 | endif() |
| 163 | endif() |
| 164 | |
| 165 | if (NOT CPU_ARCH) |
| 166 | if (${CMAKE_SYSTEM_ARCHITECTURE} STREQUAL armv8-m.main) |
| 167 | set(CPU_ARCH armv8m_ml) |
| 168 | elseif (${CMAKE_SYSTEM_ARCHITECTURE} STREQUAL armv8-m.base) |
| 169 | set(CPU_ARCH armv8m_bl) |
| 170 | elseif (${CMAKE_SYSTEM_ARCHITECTURE} STREQUAL armv7-m) |
| 171 | set(CPU_ARCH armv7m) |
| 172 | endif() |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 173 | endif() |
| 174 | |
| 175 | add_subdirectory(${PSA_ARCH_TESTS_PATH}/api-tests ${CMAKE_CURRENT_BINARY_DIR}/psa_api_tests) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 176 | endif() |
| 177 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 178 | ############################# Test integration ################################# |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 179 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 180 | add_library(tfm_ns_integration_test STATIC EXCLUDE_FROM_ALL) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 181 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 182 | target_sources(tfm_ns_integration_test |
| 183 | PRIVATE |
| 184 | tfm_integ_test.c |
| 185 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 186 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 187 | target_include_directories(tfm_ns_integration_test |
| 188 | PUBLIC |
| 189 | . |
| 190 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 191 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 192 | target_link_libraries(tfm_ns_integration_test |
| 193 | PUBLIC |
| 194 | $<$<BOOL:${TEST_NS}>:tfm_ns_tests> |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame] | 195 | tfm_test_framework_ns |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 196 | PRIVATE |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame] | 197 | tfm_ns_interface |
| 198 | tfm_api_ns |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 199 | CMSIS_5_tfm_ns |
| 200 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 201 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 202 | target_compile_definitions(tfm_ns_integration_test |
| 203 | PUBLIC |
| 204 | $<$<BOOL:${TEST_NS}>:TEST_FRAMEWORK_NS> |
| 205 | $<$<BOOL:${TEST_S}>:TEST_FRAMEWORK_S> |
| 206 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 207 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 208 | ############################# TFM NS app ####################################### |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 209 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 210 | add_executable(tfm_ns) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 211 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 212 | target_sources(tfm_ns |
| 213 | PRIVATE |
| 214 | main_ns.c |
Kevin Peng | 0d3a381 | 2020-12-23 02:17:57 +0000 | [diff] [blame] | 215 | $<$<BOOL:${TEST_PSA_API}>:psa_api_test.c> |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 216 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 217 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 218 | target_link_libraries(tfm_ns |
| 219 | PRIVATE |
| 220 | platform_ns |
| 221 | CMSIS_5_tfm_ns |
| 222 | $<$<OR:$<BOOL:${TEST_NS}>,$<BOOL:${TEST_S}>>:tfm_ns_integration_test> |
Kevin Peng | 0d3a381 | 2020-12-23 02:17:57 +0000 | [diff] [blame] | 223 | $<$<BOOL:${TEST_PSA_API}>:val_nspe> |
| 224 | $<$<BOOL:${TEST_PSA_API}>:pal_nspe> |
| 225 | $<$<BOOL:${TEST_PSA_API}>:test_combine> |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 226 | $<$<NOT:$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>>:tfm_s_veneers> |
David Hu | 73f259b | 2020-12-07 10:58:41 +0800 | [diff] [blame] | 227 | tfm_api_ns |
Kevin Peng | af60229 | 2020-10-20 17:49:52 +0800 | [diff] [blame] | 228 | tfm_ns_log |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 229 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 230 | |
Kevin Peng | 0d3a381 | 2020-12-23 02:17:57 +0000 | [diff] [blame] | 231 | target_compile_definitions(tfm_ns |
| 232 | PUBLIC |
| 233 | $<$<BOOL:${TEST_PSA_API}>:PSA_API_TEST_NS> |
| 234 | ) |
| 235 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 236 | set_target_properties(tfm_ns PROPERTIES |
| 237 | SUFFIX ".axf" |
| 238 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" |
| 239 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 240 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 241 | target_link_options(tfm_ns |
| 242 | PRIVATE |
| 243 | $<$<C_COMPILER_ID:GNU>:-Wl,-Map=${CMAKE_BINARY_DIR}/bin/tfm_ns.map> |
| 244 | $<$<C_COMPILER_ID:ARMClang>:--map> |
TTornblom | d35ffa0 | 2020-09-29 13:31:31 +0200 | [diff] [blame] | 245 | $<$<C_COMPILER_ID:IAR>:--map\;${CMAKE_BINARY_DIR}/bin/tfm_ns.map> |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 246 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 247 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 248 | add_convert_to_bin_target(tfm_ns) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 249 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 250 | ############################# CMSIS ############################################ |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 251 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 252 | include(FetchContent) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 253 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 254 | set(FETCHCONTENT_QUIET FALSE) |
| 255 | cmake_policy(SET CMP0079 NEW) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 256 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 257 | add_library(CMSIS_5_tfm_ns INTERFACE) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 258 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 259 | target_sources(CMSIS_5_tfm_ns |
| 260 | INTERFACE |
| 261 | ${CMSIS_5_PATH}/RTOS2/RTX/Config/RTX_Config.c |
| 262 | ${CMSIS_5_PATH}/RTOS2/RTX/Source/rtx_lib.c |
| 263 | ${CMAKE_CURRENT_SOURCE_DIR}/os_wrapper_cmsis_rtos_v2.c |
| 264 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 265 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 266 | target_include_directories(CMSIS_5_tfm_ns |
| 267 | INTERFACE |
| 268 | ${CMSIS_5_PATH}/Core/Include |
| 269 | ${CMSIS_5_PATH}/RTOS2/Include |
| 270 | ${CMSIS_5_PATH}/RTOS2/RTX/Include |
| 271 | ${CMSIS_5_PATH}/RTOS2/RTX/Config |
| 272 | ) |
Kevin Peng | 62a8711 | 2020-07-07 15:07:46 +0800 | [diff] [blame] | 273 | |
Raef Coles | 5ee45ed | 2020-09-24 11:25:44 +0100 | [diff] [blame] | 274 | target_link_libraries(CMSIS_5_tfm_ns |
| 275 | INTERFACE |
| 276 | platform_ns |
| 277 | ) |