Julian Hall | eff4b28 | 2020-11-23 18:24:12 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Balint Dobszay | 047aea8 | 2022-05-16 14:20:53 +0200 | [diff] [blame] | 2 | # Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved. |
Julian Hall | eff4b28 | 2020-11-23 18:24:12 +0100 | [diff] [blame] | 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
Balint Dobszay | 047aea8 | 2022-05-16 14:20:53 +0200 | [diff] [blame] | 7 | cmake_minimum_required(VERSION 3.18 FATAL_ERROR) |
Julian Hall | eff4b28 | 2020-11-23 18:24:12 +0100 | [diff] [blame] | 8 | include(../../deployment.cmake REQUIRED) |
| 9 | |
| 10 | #------------------------------------------------------------------------------- |
| 11 | # The CMakeLists.txt for building the component-test deployment for arm-linux |
| 12 | # |
| 13 | # Used for building and running component level tests as a Linux userspace |
| 14 | # program running on Arm. Tests can be run by running the built executable |
| 15 | # called "component-test" |
| 16 | #------------------------------------------------------------------------------- |
| 17 | include(${TS_ROOT}/environments/arm-linux/env.cmake) |
| 18 | project(trusted-services LANGUAGES CXX C) |
| 19 | add_executable(component-test) |
| 20 | target_include_directories(component-test PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}") |
| 21 | |
Imre Kis | 7cbf6a2 | 2021-01-25 18:50:35 +0100 | [diff] [blame] | 22 | add_components( |
| 23 | TARGET "component-test" |
| 24 | BASE_DIR ${TS_ROOT} |
| 25 | COMPONENTS "components/app/test-runner" |
| 26 | ) |
| 27 | |
| 28 | include(${TS_ROOT}/external/CppUTest/CppUTest.cmake) |
Gyorgy Szing | 36cc492 | 2022-10-11 15:52:53 +0000 | [diff] [blame] | 29 | target_link_libraries(component-test PRIVATE ${CppUTest_LIBRARIES}) |
Imre Kis | 7cbf6a2 | 2021-01-25 18:50:35 +0100 | [diff] [blame] | 30 | |
Julian Hall | eff4b28 | 2020-11-23 18:24:12 +0100 | [diff] [blame] | 31 | #------------------------------------------------------------------------------- |
julhal01 | ffa98d8 | 2021-01-20 13:51:58 +0000 | [diff] [blame] | 32 | # Components that are specific to deployment in the arm-linux environment. |
| 33 | # |
| 34 | #------------------------------------------------------------------------------- |
| 35 | add_components( |
| 36 | TARGET "component-test" |
| 37 | BASE_DIR ${TS_ROOT} |
| 38 | COMPONENTS |
Julian Hall | 9061e6c | 2021-06-29 14:24:20 +0100 | [diff] [blame] | 39 | "components/service/crypto/backend/mbedcrypto/trng_adapter/linux" |
julhal01 | ffa98d8 | 2021-01-20 13:51:58 +0000 | [diff] [blame] | 40 | ) |
| 41 | |
| 42 | #------------------------------------------------------------------------------- |
Julian Hall | eff4b28 | 2020-11-23 18:24:12 +0100 | [diff] [blame] | 43 | # Extend with components that are common across all deployments of |
| 44 | # component-test |
| 45 | # |
| 46 | #------------------------------------------------------------------------------- |
| 47 | include(../component-test.cmake REQUIRED) |
| 48 | |
| 49 | #------------------------------------------------------------------------------- |
| 50 | # Define library options and dependencies. |
| 51 | # |
| 52 | #------------------------------------------------------------------------------- |
Julian Hall | eff4b28 | 2020-11-23 18:24:12 +0100 | [diff] [blame] | 53 | target_link_libraries(component-test PRIVATE stdc++ gcc m) |