1#-------------------------------------------------------------------------------
2# Copyright (c) 2021-2023, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8#-------------------------------------------------------------------------------
9#  The base build file shared between deployments of 'psa-api-test' for
10#  different environments.  Used for running PSA API tests.
11#-------------------------------------------------------------------------------
12
13#-------------------------------------------------------------------------------
14#  Components that are common across all deployments
15#
16#-------------------------------------------------------------------------------
17
18target_sources(${PROJECT_NAME} PRIVATE
19	${TS_ROOT}/deployments/psa-api-test/arch_test_runner.c
20)
21
22#-------------------------------------------------------------------------------
23#  Use libpsats for locating PSA services. An appropriate version of
24#  libpsats will be imported for the environment. Making sure the link order is
25#  correct.
26#-------------------------------------------------------------------------------
27if (COVERAGE)
28	set(LIBPSATS_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libpsats build type" FORCE)
29	set(LIBTS_BUILD_TYPE "DEBUGCOVERAGE" CACHE STRING "Libts build type" FORCE)
30endif()
31
32include(${TS_ROOT}/deployments/libpsats/libpsats-import.cmake)
33target_link_libraries( ${PROJECT_NAME} PRIVATE libpsats::psats)
34
35target_link_libraries(${PROJECT_NAME} PRIVATE val_nspe test_combine pal_nspe)
36
37#-------------------------------------------------------------------------------
38#  Export project header paths for arch tests
39#
40#-------------------------------------------------------------------------------
41get_target_property(_include_paths ${PROJECT_NAME} INCLUDE_DIRECTORIES)
42list(APPEND PSA_ARCH_TESTS_EXTERNAL_INCLUDE_PATHS ${_include_paths})
43include(${TS_ROOT}/external/psa_arch_tests/psa_arch_tests.cmake)
44
45#-------------------------------------------------------------------------------
46#  Define install content.
47#
48#-------------------------------------------------------------------------------
49if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
50	set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "location to install build output to." FORCE)
51endif()
52install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${TS_ENV}/bin)
53