blob: 328d921750bcfee406b5a8e9cffa09a687677e52 [file] [log] [blame]
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +05301#/** @file
Avi Nawaldcef7342025-07-12 01:23:45 +05302# * Copyright (c) 2019-2025, Arm Limited or its affiliates. All rights reserved.
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +05303# * SPDX-License-Identifier : Apache-2.0
jothikumar mani36b2b862023-05-05 13:51:27 +05304# * Copyright 2023 NXP
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +05305# *
6# * Licensed under the Apache License, Version 2.0 (the "License");
7# * you may not use this file except in compliance with the License.
8# * You may obtain a copy of the License at
9# *
10# * http://www.apache.org/licenses/LICENSE-2.0
11# *
12# * Unless required by applicable law or agreed to in writing, software
13# * distributed under the License is distributed on an "AS IS" BASIS,
14# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# * See the License for the specific language governing permissions and
16# * limitations under the License.
17#**/
18
19# Set the minimum required version of CMake for the project
20cmake_minimum_required(VERSION 3.10)
21
22# cmake_policy
23cmake_policy(SET CMP0057 NEW)
24
25# Find python interpreter version 3 or greater
26find_package(PythonInterp 3 REQUIRED)
27# Find Git package
28find_package(Git REQUIRED)
29
30get_filename_component(PSA_ROOT_DIR . ABSOLUTE)
31
Lingkai Dong9d4e7df2021-01-13 16:57:54 +000032include(${PSA_ROOT_DIR}/tools/cmake/common/Utils.cmake)
Avi Nawaldcef7342025-07-12 01:23:45 +053033include(${PSA_ROOT_DIR}/tools/cmake/common/CommonVAL.cmake)
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053034include(${PSA_ROOT_DIR}/tools/cmake/common/CMakeSettings.cmake)
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +053035include(${PSA_ROOT_DIR}/tools/cmake/common/CMakeExternal.cmake)
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053036
jotman016d7dd4e2020-11-10 17:32:28 +080037if(NOT DEFINED TFM_PROFILE)
38 message(STATUS "[PSA] : Building Default profile")
39list(APPEND PSA_SUITES
40 "IPC"
41 "CRYPTO"
42 "INTERNAL_TRUSTED_STORAGE"
43 "PROTECTED_STORAGE"
44 "STORAGE"
45 "INITIAL_ATTESTATION"
46)
47else()
48
49if("${TFM_PROFILE}" STREQUAL "profile_small")
50# list of supported suites
51list(APPEND PSA_SUITES
52 "CRYPTO"
53 "INTERNAL_TRUSTED_STORAGE"
54 "INITIAL_ATTESTATION"
55)
56else()
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053057# list of supported suites
58list(APPEND PSA_SUITES
59 "IPC"
60 "CRYPTO"
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053061 "INTERNAL_TRUSTED_STORAGE"
jotman016d7dd4e2020-11-10 17:32:28 +080062 "PROTECTED_STORAGE"
Vinay Kumar Kotegowder18fcd402020-04-27 17:38:41 +053063 "STORAGE"
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053064 "INITIAL_ATTESTATION"
65)
jotman016d7dd4e2020-11-10 17:32:28 +080066endif()
67endif()
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053068# list of ipc files required
69list(APPEND PSA_IPC_FILES
70 "psa/client.h"
71 "psa/service.h"
Jaykumar Pitambarbhai Patel1c2b0282019-11-06 11:29:13 +053072 "psa/lifecycle.h"
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053073 "psa_manifest/sid.h"
74 "psa_manifest/pid.h"
Jaykumar Pitambarbhai Patel1c2b0282019-11-06 11:29:13 +053075 "psa_manifest/driver_partition_psa.h"
76 "psa_manifest/client_partition_psa.h"
77 "psa_manifest/server_partition_psa.h"
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +053078)
79
80# list of crypto files required
81list(APPEND PSA_CRYPTO_FILES
82 "psa/crypto.h"
83)
84
85# list of protected_storage files required
86list(APPEND PSA_PROTECTED_STORAGE_FILES
87 "psa/protected_storage.h"
88)
89
90# list of internal_trusted_storage files required
91list(APPEND PSA_INTERNAL_TRUSTED_STORAGE_FILES
92 "psa/internal_trusted_storage.h"
93)
94
Vinay Kumar Kotegowder18fcd402020-04-27 17:38:41 +053095# list of storage files required
96list(APPEND PSA_STORAGE_FILES
97 ${PSA_INTERNAL_TRUSTED_STORAGE_FILES}
98 ${PSA_PROTECTED_STORAGE_FILES}
99)
100
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530101# list of initial_attestation files required
102list(APPEND PSA_INITIAL_ATTESTATION_FILES
103 "psa/initial_attestation.h"
104 "psa/crypto.h"
105)
106
107# list of supported toolchains
108list(APPEND PSA_TOOLCHAIN_SUPPORT
109 GNUARM
110 ARMCLANG
111 HOST_GCC
jk-arm7e6145a2021-07-19 19:36:14 +0530112 GCC_LINUX
113 INHERIT
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530114)
115
Øyvind Rønningstadc50804e2021-03-12 12:43:25 +0100116# list of supported CROSS_COMPILE toolchains
117list(APPEND CROSS_COMPILE_TOOLCHAIN_SUPPORT
118 GNUARM
jk-arm7e6145a2021-07-19 19:36:14 +0530119 ARMCLANG
120 INHERIT
Øyvind Rønningstadc50804e2021-03-12 12:43:25 +0100121)
122
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530123# list of suported CPU arch
124list(APPEND PSA_CPU_ARCH_SUPPORT
125 armv8m_ml
126 armv8m_bl
Dávid Házi330c4b12023-05-03 11:20:02 +0200127 armv81m_ml
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530128 armv7m
jothikumar mani4a274162023-07-18 00:31:22 +0800129 armv7a
jotman01bed7a152021-05-25 22:57:17 +0800130 armv8a
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530131)
132
Avi Nawaldcef7342025-07-12 01:23:45 +0530133# list of VERBOSITY options
134list(APPEND PSA_VERBOSITY_OPTIONS 1 2 3 4 5)
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530135
Jaykumar Pitambarbhai Patelccf5bf22019-12-06 11:58:32 +0530136# list of PLATFORM_PSA_ISOLATION_LEVEL options
jotman016d7dd4e2020-11-10 17:32:28 +0800137if("${TFM_PROFILE}" STREQUAL "profile_medium")
138list(APPEND PLATFORM_PSA_ISOLATION_LEVEL_OPTIONS 1 2)
139else()
Jaykumar Pitambarbhai Patelccf5bf22019-12-06 11:58:32 +0530140list(APPEND PLATFORM_PSA_ISOLATION_LEVEL_OPTIONS 1 2 3)
jotman016d7dd4e2020-11-10 17:32:28 +0800141endif()
Jaykumar Pitambarbhai Patelccf5bf22019-12-06 11:58:32 +0530142
jk-arm01ee3ff2021-10-18 22:41:47 +0530143#list of INCLUDE_PANIC_TESTS options
144list(APPEND PSA_INCLUDE_PANIC_TESTS_OPTIONS 0 1)
145
jk-armbf532fd2021-05-07 13:58:22 +0530146# list of available spec version
147if("${SUITE}" STREQUAL "STORAGE" OR ${SUITE} STREQUAL "INTERNAL_TRUSTED_STORAGE" OR ${SUITE} STREQUAL "PROTECTED_STORAGE")
148list(APPEND PSA_SPEC_VERSION
149 1.0-BETA2
150 1.0
151)
152elseif("${SUITE}" STREQUAL "CRYPTO")
153list(APPEND PSA_SPEC_VERSION
154 1.0-BETA1
155 1.0-BETA2
156 1.0-BETA3
Avi Nawal5e72bf92024-03-14 18:39:09 +0800157 1.0.0
158 1.0.1
159 1.1.0
jk-armbf532fd2021-05-07 13:58:22 +0530160)
161elseif("${SUITE}" STREQUAL "INITIAL_ATTESTATION")
162list(APPEND PSA_SPEC_VERSION
163 1.0-BETA0
164 1.0.0
165 1.0.1
166 1.0.2
167)
jk-arm957cfea2021-06-18 15:52:12 +0530168elseif("${SUITE}" STREQUAL "IPC")
169list(APPEND PSA_SPEC_VERSION
170 1.0
171 1.1
172)
jk-arm957cfea2021-06-18 15:52:12 +0530173endif()
174
175#list of values available for connection based
176if(${SUITE} STREQUAL "IPC")
177list(APPEND PSA_STATELESS_ROT 0 1)
jk-armbf532fd2021-05-07 13:58:22 +0530178endif()
179
jk-arm01ee3ff2021-10-18 22:41:47 +0530180#list of TESTS_COVERAGE available options
181list(APPEND PSA_TESTS_COVERAGE_OPTIONS
182 "ALL"
183 "PASS"
184)
185
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530186message(STATUS "[PSA] : ----------Process input arguments- start-------------")
187
188# Check for TARGET command line argument
189_check_arguments("TARGET")
190# Check for SUTIE command line argument
191_check_arguments("SUITE")
192# Check for PSA_INCLUDE_PATHS command line argument
193_check_arguments("PSA_INCLUDE_PATHS")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530194
195string(TOLOWER ${SUITE} SUITE_LOWER)
196
197# Check for valid targets
198_get_sub_dir_list(PSA_TARGET_LIST ${PSA_ROOT_DIR}/platform/targets)
199if(NOT ${TARGET} IN_LIST PSA_TARGET_LIST)
Øyvind Rønningstadabbb7272020-11-09 14:50:54 +0100200 message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DTARGET=${TARGET}, supported targets are : ${PSA_TARGET_LIST}")
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530201else()
202 message(STATUS "[PSA] : TARGET is set to ${TARGET}")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530203endif()
204
205# Check for the presence of required test suite directories
206if((NOT IS_DIRECTORY ${PSA_ROOT_DIR}/dev_apis) OR (NOT IS_DIRECTORY ${PSA_ROOT_DIR}/ff))
207 message(STATUS "[PSA] : Error: Could not find architecture test suite directories in psa root path ${PSA_ROOT_DIR}")
208endif()
209
210if(FALSE)
211# Check for build directory specified
212if(NOT DEFINED BUILD)
213 set(BUILD ${CMAKE_CURRENT_BINARY_DIR}/BUILD CACHE INTERNAL "Defaulting build directory to ${BUILD}" FORCE)
214else()
215 set(BUILD ${CMAKE_CURRENT_BINARY_DIR}/${BUILD}/BUILD CACHE INTERNAL "Defaulting build directory to ${BUILD}" FORCE)
216endif()
217endif()
218
219# Check for valid suite cmake argument passed
220if(NOT ${SUITE} IN_LIST PSA_SUITES)
Øyvind Rønningstadabbb7272020-11-09 14:50:54 +0100221 message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DSUITE=${SUITE}, select one from supported suites which are : ${PSA_SUITES}")
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530222else()
223 message(STATUS "[PSA] : SUITE is set to ${SUITE}")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530224endif()
225
226# Project variables
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530227if(${SUITE} STREQUAL "INITIAL_ATTESTATION")
Gyorgy Szing42d62332022-02-08 17:50:04 +0000228 set(PSA_TARGET_QCBOR ${CMAKE_CURRENT_BINARY_DIR}/psa_qcbor CACHE PATH "Location of Q_CBOR sources.")
Shruti Ghadge12214732024-10-28 14:22:47 +0530229
230 if(NOT DEFINED INITIAL_ATTESTATION_PROFILE_FORMAT)
231 add_definitions(-DPSA_ATTESTATION_PROFILE_1)
232 message(STATUS "[PSA] : Testing ${SUITE} for default Profile-1 token format compliant")
233 else()
234 if(${INITIAL_ATTESTATION_PROFILE_FORMAT} EQUAL 1)
235 add_definitions(-DPSA_ATTESTATION_PROFILE_1)
236 message(STATUS "[PSA] : Testing ${SUITE} for Profile-1 token format compliant")
237 elseif(${INITIAL_ATTESTATION_PROFILE_FORMAT} EQUAL 2)
238 add_definitions(-DPSA_ATTESTATION_PROFILE_2)
239 message(STATUS "[PSA] : Testing ${SUITE} for Profile-2 token format compliant")
240 else()
241 message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DINITIAL_ATTESTATION_PROFILE_FORMAT=${INITIAL_ATTESTATION_PROFILE_FORMAT}")
242 endif()
243 endif()
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530244endif()
Avi Nawaldcef7342025-07-12 01:23:45 +0530245set(PSA_TARGET_PAL_NSPE_LIB pal_nspe)
246set(COMMON_VAL_LIB common_val_lib)
247set(PSA_TARGET_VAL_NSPE_LIB val_nspe)
248set(PSA_TARGET_TEST_COMBINE_LIB test_combine)
jk-armbf532fd2021-05-07 13:58:22 +0530249set(PSA_TARGET_DRIVER_PARTITION_LIB tfm_psa_rot_partition_driver_partition)
250set(PSA_TARGET_CLIENT_PARTITION_LIB tfm_app_rot_partition_client_partition)
251set(PSA_TARGET_SERVER_PARTITION_LIB tfm_app_rot_partition_server_partition)
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530252if(${SUITE} STREQUAL "IPC")
253 set(PSA_SUITE_DIR ${PSA_ROOT_DIR}/ff/${SUITE_LOWER})
254 set(PSA_SUITE_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/ff/${SUITE_LOWER})
Vinay Kumar Kotegowder18fcd402020-04-27 17:38:41 +0530255elseif((${SUITE} STREQUAL "INTERNAL_TRUSTED_STORAGE") OR (${SUITE} STREQUAL "PROTECTED_STORAGE"))
256 set(PSA_SUITE_DIR ${PSA_ROOT_DIR}/dev_apis/storage)
257 set(PSA_SUITE_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/dev_apis/storage)
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530258else()
259 set(PSA_SUITE_DIR ${PSA_ROOT_DIR}/dev_apis/${SUITE_LOWER})
260 set(PSA_SUITE_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/dev_apis/${SUITE_LOWER})
261endif()
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530262set(PSA_TESTLIST_GENERATOR ${PSA_ROOT_DIR}/tools/scripts/gen_tests_list.py)
jk-armbf532fd2021-05-07 13:58:22 +0530263if(NOT DEFINED SPEC_VERSION)
264 if(${SUITE} STREQUAL "INTERNAL_TRUSTED_STORAGE")
265 set(TESTSUITE_DB ${PSA_SUITE_DIR}/its_testsuite.db)
266 elseif((${SUITE} STREQUAL "PROTECTED_STORAGE") OR (${SUITE} STREQUAL "STORAGE"))
267 set(TESTSUITE_DB ${PSA_SUITE_DIR}/ps_testsuite.db)
jothikumar mani18b98e02023-04-05 00:39:23 +0800268 elseif(${SUITE} STREQUAL "CRYPTO")
269 if(DEFINED BESPOKE_SUITE_TESTS)
270 set(TESTSUITE_DB ${PSA_ROOT_DIR}/platform/targets/${TARGET}/${BESPOKE_SUITE_TESTS})
271 else()
272 set(TESTSUITE_DB ${PSA_SUITE_DIR}/testsuite.db)
273 endif()
jk-armbf532fd2021-05-07 13:58:22 +0530274 else()
275 set(TESTSUITE_DB ${PSA_SUITE_DIR}/testsuite.db)
276 endif()
jothikumar mani18b98e02023-04-05 00:39:23 +0800277 message(STATUS "[PSA] : Selected test database file : ${TESTSUITE_DB}")
Vinay Kumar Kotegowder18fcd402020-04-27 17:38:41 +0530278else()
jk-armbf532fd2021-05-07 13:58:22 +0530279 if(${SUITE} STREQUAL "INTERNAL_TRUSTED_STORAGE")
280 if(${SPEC_VERSION} STREQUAL "1.0-BETA2")
281 set(TESTSUITE_DB ${PSA_SUITE_DIR}/its_1.0-beta2_testsuite.db)
282 endif()
283 if(${SPEC_VERSION} STREQUAL "1.0")
284 set(TESTSUITE_DB ${PSA_SUITE_DIR}/its_1.0_testsuite.db)
285 endif()
286 elseif((${SUITE} STREQUAL "PROTECTED_STORAGE") OR (${SUITE} STREQUAL "STORAGE"))
287 if(${SPEC_VERSION} STREQUAL "1.0-BETA2")
288 set(TESTSUITE_DB ${PSA_SUITE_DIR}/ps_1.0-beta2_testsuite.db)
289 endif()
290 if(${SPEC_VERSION} STREQUAL "1.0")
291 set(TESTSUITE_DB ${PSA_SUITE_DIR}/ps_1.0_testsuite.db)
292 endif()
293 elseif(${SUITE} STREQUAL "CRYPTO")
294 if(${SPEC_VERSION} STREQUAL "1.0-BETA1")
295 set(TESTSUITE_DB ${PSA_SUITE_DIR}/1.0-beta1_testsuite.db)
296 endif()
297 if(${SPEC_VERSION} STREQUAL "1.0-BETA2")
298 set(TESTSUITE_DB ${PSA_SUITE_DIR}/1.0-beta2_testsuite.db)
299 endif()
300 if(${SPEC_VERSION} STREQUAL "1.0-BETA3")
301 set(TESTSUITE_DB ${PSA_SUITE_DIR}/1.0-beta3_testsuite.db)
302 endif()
Avi Nawal5e72bf92024-03-14 18:39:09 +0800303 if(${SPEC_VERSION} STREQUAL "1.0.0")
304 set(TESTSUITE_DB ${PSA_SUITE_DIR}/1.0.0_testsuite.db)
305 endif()
306 if(${SPEC_VERSION} STREQUAL "1.0.1")
307 set(TESTSUITE_DB ${PSA_SUITE_DIR}/1.0.1_testsuite.db)
308 endif()
309 if(${SPEC_VERSION} STREQUAL "1.1.0")
310 set(TESTSUITE_DB ${PSA_SUITE_DIR}/1.1.0_testsuite.db)
311 endif()
jk-armbf532fd2021-05-07 13:58:22 +0530312 elseif(${SUITE} STREQUAL "INITIAL_ATTESTATION")
313 if(${SPEC_VERSION} STREQUAL "1.0-BETA0")
314 set(TESTSUITE_DB ${PSA_SUITE_DIR}/1.0-beta0_testsuite.db)
315 endif()
316 if(${SPEC_VERSION} STREQUAL "1.0.0")
317 set(TESTSUITE_DB ${PSA_SUITE_DIR}/1.0.0_testsuite.db)
318 endif()
319 if(${SPEC_VERSION} STREQUAL "1.0.1")
320 set(TESTSUITE_DB ${PSA_SUITE_DIR}/1.0.1_testsuite.db)
321 endif()
322 if(${SPEC_VERSION} STREQUAL "1.0.2")
323 set(TESTSUITE_DB ${PSA_SUITE_DIR}/1.0.2_testsuite.db)
324 endif()
jk-arm957cfea2021-06-18 15:52:12 +0530325 elseif(${SUITE} STREQUAL "IPC")
326 if(${SPEC_VERSION} STREQUAL "1.1")
327 if(DEFINED STATELESS_ROT_TESTS)
328 if(${STATELESS_ROT_TESTS} EQUAL 1)
329 set(TESTSUITE_DB ${PSA_SUITE_DIR}/stateless_rot_testsuite.db)
330 else()
331 set(TESTSUITE_DB ${PSA_SUITE_DIR}/testsuite.db)
332 endif()
333 else()
334 set(TESTSUITE_DB ${PSA_SUITE_DIR}/testsuite.db)
335 endif()
336 else()
337 set(TESTSUITE_DB ${PSA_SUITE_DIR}/testsuite.db)
338 endif()
339 endif()
Vinay Kumar Kotegowder18fcd402020-04-27 17:38:41 +0530340endif()
341set(PSA_TESTLIST_FILE ${CMAKE_CURRENT_BINARY_DIR}/${SUITE_LOWER}_testlist.txt)
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530342set(PSA_TEST_ENTRY_LIST_INC ${CMAKE_CURRENT_BINARY_DIR}/test_entry_list.inc)
343set(PSA_TEST_ENTRY_FUN_DECLARE_INC ${CMAKE_CURRENT_BINARY_DIR}/test_entry_fn_declare_list.inc)
344set(PSA_CLIENT_TEST_LIST_DELCARE_INC ${CMAKE_CURRENT_BINARY_DIR}/client_tests_list_declare.inc)
345set(PSA_CLIENT_TEST_LIST_INC ${CMAKE_CURRENT_BINARY_DIR}/client_tests_list.inc)
346set(PSA_SERVER_TEST_LIST_DECLARE_INC ${CMAKE_CURRENT_BINARY_DIR}/server_tests_list_declare.inc)
347set(PSA_SERVER_TEST_LIST ${CMAKE_CURRENT_BINARY_DIR}/server_tests_list.inc)
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530348if(${SUITE} STREQUAL "INITIAL_ATTESTATION")
Gyorgy Szing42d62332022-02-08 17:50:04 +0000349 set(PSA_QCBOR_INCLUDE_PATH ${PSA_TARGET_QCBOR}/inc)
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530350endif()
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530351
352# Validity check for required files for a given suite
353if(NOT DEFINED PSA_${SUITE}_FILES)
354 message(FATAL_ERROR "[PSA] : List of file/s to verify against ${suite} is not defined")
355endif()
356foreach(file_item ${PSA_${SUITE}_FILES})
357 set(PSA_FILE_FOUND FALSE)
358 foreach(include_path ${PSA_INCLUDE_PATHS})
359 if((EXISTS ${include_path}/${file_item}) AND
360 (NOT PSA_FILE_FOUND))
361 set(PSA_FILE_FOUND TRUE)
362 break()
363 endif()
364 endforeach()
365 if(NOT PSA_FILE_FOUND)
366 message(FATAL_ERROR "[PSA] : Couldn't find ${file_item} in ${PSA_INCLUDE_PATHS}")
367 endif()
368endforeach()
369
370# Check for TOOLCHAIN command line argument
371if(NOT DEFINED TOOLCHAIN)
372 set(TOOLCHAIN "GNUARM" CACHE INTERNAL "Compiler used" FORCE)
373 message(STATUS "[PSA] : Defaulting compiler to ${TOOLCHAIN}")
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530374else()
375 message(STATUS "[PSA] : TOOLCHAIN is set to ${TOOLCHAIN}")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530376endif()
377
Gowtham Siddarth1d6d4692019-09-16 11:47:29 +0530378if(${TOOLCHAIN} STREQUAL "ARMCLANG" OR ${TOOLCHAIN} STREQUAL "GNUARM")
379 if(NOT DEFINED CPU_ARCH)
380 message(FATAL_ERROR "[PSA] : Error: -DCPU_ARCH option missing")
381 else()
382 # Check for CPU architecture
383 if(NOT ${CPU_ARCH} IN_LIST PSA_CPU_ARCH_SUPPORT)
Øyvind Rønningstadabbb7272020-11-09 14:50:54 +0100384 message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DCPU_ARCH=${CPU_ARCH}, supported CPU arch are : ${PSA_CPU_ARCH_SUPPORT}")
Gowtham Siddarth1d6d4692019-09-16 11:47:29 +0530385 endif()
386 endif()
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530387 message(STATUS "[PSA] : CPU_ARCH is set to ${CPU_ARCH}")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530388endif()
389
Avi Nawaldcef7342025-07-12 01:23:45 +0530390# Check for VERBOSITY
391if(NOT DEFINED VERBOSITY)
392 set(VERBOSITY 3 CACHE INTERNAL "Default VERBOSITY value" FORCE)
393 message(STATUS "[PSA] : Defaulting VERBOSITY to ${VERBOSITY}")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530394else()
Avi Nawaldcef7342025-07-12 01:23:45 +0530395 if(NOT ${VERBOSITY} IN_LIST PSA_VERBOSITY_OPTIONS)
396 message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DVERBOSITY=${VERBOSITY}, supported values are : ${PSA_VERBOSITY_OPTIONS}")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530397 endif()
Avi Nawaldcef7342025-07-12 01:23:45 +0530398 message(STATUS "[PSA] : VERBOSITY is set to ${VERBOSITY}")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530399endif()
400
Jaykumar Pitambarbhai Patelccf5bf22019-12-06 11:58:32 +0530401# Check for PLATFORM_PSA_ISOLATION_LEVEL
402if(NOT DEFINED PLATFORM_PSA_ISOLATION_LEVEL)
jotman016d7dd4e2020-11-10 17:32:28 +0800403 if("${TFM_PROFILE}" STREQUAL "profile_medium")
404 set(PLATFORM_PSA_ISOLATION_LEVEL 2 CACHE INTERNAL "Default PLATFORM_PSA_ISOLATION_LEVEL value" FORCE)
405 else()
Jaykumar Pitambarbhai Patelccf5bf22019-12-06 11:58:32 +0530406 set(PLATFORM_PSA_ISOLATION_LEVEL 3 CACHE INTERNAL "Default PLATFORM_PSA_ISOLATION_LEVEL value" FORCE)
jotman016d7dd4e2020-11-10 17:32:28 +0800407 endif()
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530408 if(${SUITE} STREQUAL "IPC")
409 message(STATUS "[PSA] : Defaulting PLATFORM_PSA_ISOLATION_LEVEL to ${PLATFORM_PSA_ISOLATION_LEVEL}")
410 endif()
Jaykumar Pitambarbhai Patelccf5bf22019-12-06 11:58:32 +0530411else()
412 if(NOT ${PLATFORM_PSA_ISOLATION_LEVEL} IN_LIST PLATFORM_PSA_ISOLATION_LEVEL_OPTIONS)
Øyvind Rønningstadabbb7272020-11-09 14:50:54 +0100413 message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DPLATFORM_PSA_ISOLATION_LEVEL=${PLATFORM_PSA_ISOLATION_LEVEL}, supported values are : ${PLATFORM_PSA_ISOLATION_LEVEL_OPTIONS}")
Jaykumar Pitambarbhai Patelccf5bf22019-12-06 11:58:32 +0530414 endif()
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530415 if(${SUITE} STREQUAL "IPC")
416 message(STATUS "[PSA] : PLATFORM_PSA_ISOLATION_LEVEL is set to ${PLATFORM_PSA_ISOLATION_LEVEL}")
417 endif()
Jaykumar Pitambarbhai Patelccf5bf22019-12-06 11:58:32 +0530418endif()
419
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530420if(NOT DEFINED INCLUDE_PANIC_TESTS)
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530421 #By default panic tests are disabled
422 set(INCLUDE_PANIC_TESTS 0 CACHE INTERNAL "Default INCLUDE_PANIC_TESTS value" FORCE)
423 message(STATUS "[PSA] : Defaulting INCLUDE_PANIC_TESTS to ${INCLUDE_PANIC_TESTS}")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530424else()
jk-arm01ee3ff2021-10-18 22:41:47 +0530425 if(NOT ${INCLUDE_PANIC_TESTS} IN_LIST PSA_INCLUDE_PANIC_TESTS_OPTIONS)
426 message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DINCLUDE_PANIC_TESTS=${INCLUDE_PANIC_TESTS}, supported values are : ${PSA_INCLUDE_PANIC_TESTS_OPTIONS}")
427 endif()
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530428 if(INCLUDE_PANIC_TESTS EQUAL 1)
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530429 message(STATUS "[PSA] : "
430 "INCLUDE_PANIC_TESTS set to 1, therefore including PSA APIs panic tests into the regression,\n"
Avi Nawaldcef7342025-07-12 01:23:45 +0530431 "\tensure that WATCHDOG_NUM is set to 1 in ${PSA_ROOT_DIR}/platform/targets/${TARGET}/nspe/pal_config.h")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530432 endif()
433endif()
434
435if(NOT DEFINED WATCHDOG_AVAILABLE)
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530436 #Assuming watchdog is available to program by test suite
437 set(WATCHDOG_AVAILABLE 1 CACHE INTERNAL "Default WATCHDOG_AVAILABLE value" FORCE)
438 message(STATUS "[PSA] : Defaulting WATCHDOG_AVAILABLE to ${WATCHDOG_AVAILABLE}")
439else()
440 message(STATUS "[PSA] : WATCHDOG_AVAILABLE is set to ${WATCHDOG_AVAILABLE}")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530441endif()
442
443if((INCLUDE_PANIC_TESTS EQUAL 1) AND
444 (WATCHDOG_AVAILABLE EQUAL 0))
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530445 message(WARNING "[PSA]: "
446 "Note that to test PSA APIs panic conditions, test harness may require to access"
447 "the watchdog timer in oder to recover from panic and to be able to continue with"
448 "next test. Ignore this warning if system under test has capability to reset the"
449 "system when it encounters panic condition.")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530450endif()
451
452if(NOT DEFINED SP_HEAP_MEM_SUPP)
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530453 #Are dynamic memory functions available to secure partition?
454 set(SP_HEAP_MEM_SUPP 1 CACHE INTERNAL "Default SP_HEAP_MEM_SUPP value" FORCE)
455 message(STATUS "[PSA] : Defaulting SP_HEAP_MEM_SUPP to ${SP_HEAP_MEM_SUPP}")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530456endif()
457
Vinay Kumar Kotegowderac218992020-04-03 12:56:00 +0530458if(NOT DEFINED SUITE_TEST_RANGE)
459 set(SUITE_TEST_RANGE_MIN None)
460 set(SUITE_TEST_RANGE_MAX None)
461else()
462 list(LENGTH SUITE_TEST_RANGE SUITE_TEST_RANGE_LENGTH)
463 if(${SUITE_TEST_RANGE_LENGTH} GREATER "2")
464 message(FATAL_ERROR "[PSA] : -DSUITE_TEST_RANGE=<...> value error! accepts two "
465 " numbers in quotes separated with ';'")
466 endif()
467 if(${SUITE_TEST_RANGE_LENGTH} EQUAL "2")
468 list(GET SUITE_TEST_RANGE 0 SUITE_TEST_RANGE_MIN)
469 list(GET SUITE_TEST_RANGE 1 SUITE_TEST_RANGE_MAX)
470 message(STATUS "[PSA] : Testing (${SUITE_TEST_RANGE_MIN}, ${SUITE_TEST_RANGE_MAX}) of ${SUITE} suite")
471 endif()
472 if(${SUITE_TEST_RANGE_LENGTH} EQUAL "1")
473 set(SUITE_TEST_RANGE_MIN ${SUITE_TEST_RANGE})
474 set(SUITE_TEST_RANGE_MAX ${SUITE_TEST_RANGE})
475 message(STATUS "[PSA] : Testing ${SUITE_TEST_RANGE_MIN} of ${SUITE} suite")
476 endif()
477endif()
478
jk-armbf532fd2021-05-07 13:58:22 +0530479if(NOT DEFINED SPEC_VERSION)
480 message(STATUS "[PSA] : Default spec version")
481else()
482 if(NOT ${SPEC_VERSION} IN_LIST PSA_SPEC_VERSION)
483 message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DSPEC_VERSION=${SPEC_VERSION}, supported values are : ${PSA_SPEC_VERSION} for ${SUITE}")
484 else()
485 message(STATUS "[PSA] : Testing ${SUITE} for spec version ${SPEC_VERSION}")
486 endif()
487endif()
488
jk-arm957cfea2021-06-18 15:52:12 +0530489if(DEFINED STATELESS_ROT_TESTS)
490 if(NOT ${STATELESS_ROT_TESTS} IN_LIST PSA_STATELESS_ROT)
491 message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DSTATELESS_ROT_TESTS=${STATELESS_ROT_TESTS}, supported values are : ${PSA_STATELESS_ROT}")
492 elseif(${STATELESS_ROT_TESTS} EQUAL 1)
493 message(STATUS "[PSA] : Testing ${SUITE} for stateless rot")
494 elseif(${STATELESS_ROT_TESTS} EQUAL 0)
495 message(STATUS "[PSA] : Testing ${SUITE} for connection based")
496 endif()
497
498 if(NOT DEFINED SPEC_VERSION)
499 message(FATAL_ERROR "[PSA] : Error: SPEC_VERSION is require for STATELESS_ROT_TESTS.")
500 elseif(${SUITE} STREQUAL "IPC")
501 if(${SPEC_VERSION} STREQUAL "1.0")
502 message(FATAL_ERROR "[PSA] : Error: STATELESS_ROT_TESTS is only valid for SPEC_VERSION=1.1.")
503 elseif(${SPEC_VERSION} STREQUAL "1.1")
504 add_definitions(-DSPEC_VERSION=11)
505 if(${STATELESS_ROT_TESTS} EQUAL 1)
506 add_definitions(-DSTATELESS_ROT=1)
507 elseif(${STATELESS_ROT_TESTS} EQUAL 0)
508 add_definitions(-DSTATELESS_ROT=0)
509 endif()
510 endif()
511 else()
512 message(FATAL_ERROR "[PSA] : Error: STATELESS_ROT_TESTS is only applicable to IPC Test Suite.")
513 endif()
514else()
515 add_definitions(-DSTATELESS_ROT=0)
516 if(DEFINED SPEC_VERSION)
517 if(${SUITE} STREQUAL "IPC")
518 if(${SPEC_VERSION} STREQUAL "1.0")
519 add_definitions(-DSPEC_VERSION=10)
520 endif()
521 if(${SPEC_VERSION} STREQUAL "1.1")
522 add_definitions(-DSPEC_VERSION=11)
523 endif()
524 endif()
525 endif()
526endif()
527
jk-arm01ee3ff2021-10-18 22:41:47 +0530528if(NOT DEFINED TESTS_COVERAGE)
529 #By default all tests are included
530 set(TESTS_COVERAGE "ALL" CACHE INTERNAL "Default TESTS_COVERAGE value" FORCE)
531 message(STATUS "[PSA] : Defaulting TESTS_COVERAGE to ${TESTS_COVERAGE}")
532else()
533 if(NOT ${TESTS_COVERAGE} IN_LIST PSA_TESTS_COVERAGE_OPTIONS)
534 message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DTESTS_COVERAGE=${TESTS_COVERAGE}, supported values are : ${PSA_TESTS_COVERAGE_OPTIONS}")
535 endif()
536 if(TESTS_COVERAGE STREQUAL ALL)
537 message(STATUS "[PSA] : "
538 "TESTS_COVERAGE set to ALL, therefore all tests are included.")
539 endif()
540 if(TESTS_COVERAGE STREQUAL PASS)
541 message(STATUS "[PSA] : "
542 "TESTS_COVERAGE set to PASS, therefore known failure tests are not included.")
543 add_definitions(-DTESTS_COVERAGE)
544 endif()
545endif()
546
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530547message(STATUS "[PSA] : ----------Process input arguments- complete-------------")
548
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530549
Gyorgy Szing42d62332022-02-08 17:50:04 +0000550if((${SUITE} STREQUAL "INITIAL_ATTESTATION") AND (NOT EXISTS ${PSA_TARGET_QCBOR}))
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530551# Clone QCBOR and move to specified tag
552execute_process(COMMAND ${GIT_EXECUTABLE} clone ${PSA_QCBOR_GIT_REPO_LINK} ${PSA_TARGET_QCBOR}
Gyorgy Szing42d62332022-02-08 17:50:04 +0000553 RESULT_VARIABLE qcbor_clone_result
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530554 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
Gyorgy Szing42d62332022-02-08 17:50:04 +0000555if(qcbor_clone_result)
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530556 message(FATAL_ERROR "git clone failed for ${PSA_QCBOR_GIT_REPO_LINK}")
557endif()
558
Gyorgy Szing42d62332022-02-08 17:50:04 +0000559if(NOT qcbor_clone_result)
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530560execute_process(COMMAND ${GIT_EXECUTABLE} checkout -q "${PSA_QCBOR_GIT_REPO_TAG}"
Gyorgy Szing42d62332022-02-08 17:50:04 +0000561 RESULT_VARIABLE qcbor_checkout_result
562 WORKING_DIRECTORY ${PSA_TARGET_QCBOR})
563if(qcbor_checkout_result)
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530564 message(FATAL_ERROR "git checkout failed for Repo : ${PSA_QCBOR_GIT_REPO_LINK}, Tag : ${PSA_QCBOR_GIT_REPO_TAG}")
565endif()
566endif()
567endif()
gowtham siddarth12833042020-02-10 22:11:11 +0530568
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530569# Create PSA clean list
570list(APPEND PSA_CLEAN_LIST
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530571 ${PSA_TESTLIST_FILE}
572 ${PSA_TEST_ENTRY_LIST_INC}
573 ${PSA_TEST_ENTRY_FUN_DECLARE_INC}
574 ${PSA_CLIENT_TEST_LIST_DELCARE_INC}
575 ${PSA_CLIENT_TEST_LIST_INC}
576 ${PSA_SERVER_TEST_LIST_DECLARE_INC}
577 ${PSA_SERVER_TEST_LIST}
578)
579
580# Process testsuite.db
581message(STATUS "[PSA] : Creating testlist.txt 'available at ${PSA_TESTLIST_FILE}'")
582execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PSA_TESTLIST_GENERATOR}
583 ${SUITE_LOWER}
584 ${TESTSUITE_DB}
585 ${INCLUDE_PANIC_TESTS}
jk-arm01ee3ff2021-10-18 22:41:47 +0530586 ${TESTS_COVERAGE}
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530587 ${PSA_TESTLIST_FILE}
588 ${PSA_TEST_ENTRY_LIST_INC}
589 ${PSA_TEST_ENTRY_FUN_DECLARE_INC}
590 ${PSA_CLIENT_TEST_LIST_DELCARE_INC}
591 ${PSA_CLIENT_TEST_LIST_INC}
592 ${PSA_SERVER_TEST_LIST_DECLARE_INC}
Vinay Kumar Kotegowderac218992020-04-03 12:56:00 +0530593 ${PSA_SERVER_TEST_LIST}
594 ${SUITE_TEST_RANGE_MIN}
595 ${SUITE_TEST_RANGE_MAX})
Jaykumar Pitambarbhai Patelccf5bf22019-12-06 11:58:32 +0530596
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530597# Creating CMake list variable from file
598file(READ ${PSA_TESTLIST_FILE} PSA_TEST_LIST)
Vinay Kumar Kotegowderac218992020-04-03 12:56:00 +0530599if(NOT PSA_TEST_LIST)
600 message(FATAL_ERROR "[PSA] : Invalid test number!")
601endif()
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530602string(REGEX REPLACE "\n" ";" PSA_TEST_LIST "${PSA_TEST_LIST}")
603
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530604# Check for supported toolchain/s
605if(${TOOLCHAIN} IN_LIST PSA_TOOLCHAIN_SUPPORT)
jk-armbf532fd2021-05-07 13:58:22 +0530606 if (DEFINED CROSS_COMPILE)
jk-arm7e6145a2021-07-19 19:36:14 +0530607 if(NOT (${TOOLCHAIN} IN_LIST CROSS_COMPILE_TOOLCHAIN_SUPPORT))
608 message(FATAL_ERROR "[PSA] : Error: CROSS_COMPILE not supported for this toolchain, supported toolchain are : ${CROSS_COMPILE_TOOLCHAIN_SUPPORT}")
609 endif()
jk-armbf532fd2021-05-07 13:58:22 +0530610 endif()
jk-arm7e6145a2021-07-19 19:36:14 +0530611 include(${PSA_ROOT_DIR}/tools/cmake/compiler/${TOOLCHAIN}.cmake)
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530612else()
jk-arm7e6145a2021-07-19 19:36:14 +0530613 message(FATAL_ERROR "[PSA] : Error: Unsupported value for -DTOOLCHAIN=${TOOLCHAIN}, supported toolchain are : ${PSA_TOOLCHAIN_SUPPORT}")
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530614endif()
615
616# Global macro to identify the PSA test suite cmake build
617add_definitions(-DPSA_CMAKE_BUILD)
618add_definitions(-D${SUITE})
Avi Nawaldcef7342025-07-12 01:23:45 +0530619add_definitions(-DVERBOSITY=${VERBOSITY})
Jaykumar Pitambarbhai Patelccf5bf22019-12-06 11:58:32 +0530620add_definitions(-DPLATFORM_PSA_ISOLATION_LEVEL=${PLATFORM_PSA_ISOLATION_LEVEL})
Vinay Kumar Kotegowder52bbfc92020-07-03 17:23:59 +0530621add_definitions(-D${TARGET})
jotman016d7dd4e2020-11-10 17:32:28 +0800622if("${TFM_PROFILE}" STREQUAL "profile_small")
623 message(STATUS "[PSA] : Building SMALL profile")
624 add_definitions(-DTF_M_PROFILE_SMALL)
625elseif("${TFM_PROFILE}" STREQUAL "profile_medium")
626 message(STATUS "[PSA] : Building MEDIUM profile")
627 add_definitions(-DTF_M_PROFILE_MEDIUM)
628endif()
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530629if(${SP_HEAP_MEM_SUPP} EQUAL 1)
630 add_definitions(-DSP_HEAP_MEM_SUPP)
631endif()
jotman0138cb53a2023-02-14 16:27:06 +0800632
Summer Qin937a1ed2022-07-13 10:29:26 +0800633if(${CC312_LEGACY_DRIVER_API_ENABLED})
634 add_definitions(-DCC312_LEGACY_DRIVER_API_ENABLED)
635endif()
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530636
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530637# Build PAL NSPE LIB
Bruno De Smet593db412023-03-15 18:47:19 +0100638include(${PSA_ROOT_DIR}/platform/targets/common/nspe/pal_nspe.cmake)
Jaykumar Pitambarbhai Patel6c3b8082020-02-26 19:51:37 +0530639include(${PSA_ROOT_DIR}/platform/targets/${TARGET}/target.cmake)
Avi Nawaldcef7342025-07-12 01:23:45 +0530640# Build COMMON VAL LIB
641add_definitions(-DSTATIC_ASSERT_CHECKS)
642include(${COMMON_VAL_PATH}/common_val.cmake)
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530643# Build VAL NSPE LIB
644#add_definitions(-DVAL_NSPE_BUILD)
645include(${PSA_ROOT_DIR}/val/val_nspe.cmake)
646# Build test
647include(${PSA_SUITE_DIR}/suite.cmake)
648if(${SUITE} STREQUAL "IPC")
649# Build SPE LIB
650include(${PSA_ROOT_DIR}/val/val_spe.cmake)
651endif()
652
Avi Nawaldcef7342025-07-12 01:23:45 +0530653# Link Common VAL library to both Non-secure and Secure VAL libraries
654target_link_libraries(val_nspe PRIVATE common_val_lib)
655if(${SUITE} STREQUAL "IPC")
656target_link_libraries(tfm_psa_rot_partition_driver_partition PRIVATE common_val_lib)
657endif()
658
659add_dependencies(${COMMON_VAL_LIB} ${PSA_TARGET_PAL_NSPE_LIB})
660add_dependencies(${PSA_TARGET_VAL_NSPE_LIB} ${COMMON_VAL_LIB})
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530661add_dependencies(${PSA_TARGET_TEST_COMBINE_LIB} ${PSA_TARGET_VAL_NSPE_LIB})
662if(${SUITE} STREQUAL "IPC")
663add_dependencies(${PSA_TARGET_DRIVER_PARTITION_LIB} ${PSA_TARGET_TEST_COMBINE_LIB})
664add_dependencies(${PSA_TARGET_CLIENT_PARTITION_LIB} ${PSA_TARGET_DRIVER_PARTITION_LIB})
665add_dependencies(${PSA_TARGET_SERVER_PARTITION_LIB} ${PSA_TARGET_CLIENT_PARTITION_LIB})
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530666endif()
667
668# Include the files for make clean
669foreach(clean_item ${PSA_CLEAN_LIST})
670 set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${clean_item})
671endforeach()
672
673set_property(TARGET ${PSA_TARGET_VAL_NSPE_LIB} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/val)
674set_property(TARGET ${PSA_TARGET_PAL_NSPE_LIB} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/platform)
Avi Nawaldcef7342025-07-12 01:23:45 +0530675set_property(TARGET ${COMMON_VAL_LIB} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${COMMON_VAL_PATH})
Vinay Kumar Kotegowder9982f902019-07-15 09:13:54 +0530676set_property(TARGET ${PSA_TARGET_TEST_COMBINE_LIB} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${PSA_SUITE_OUT_DIR})
677if(${SUITE} STREQUAL "IPC")
678set_property(TARGET ${PSA_TARGET_DRIVER_PARTITION_LIB} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/partition)
679set_property(TARGET ${PSA_TARGET_CLIENT_PARTITION_LIB} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/partition)
680set_property(TARGET ${PSA_TARGET_SERVER_PARTITION_LIB} PROPERTY ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/partition)
681endif()