Gabor Toth | 172659d | 2023-04-27 08:51:21 +0200 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2023, Arm Limited and Contributors. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | cmake_minimum_required(VERSION 3.18 FATAL_ERROR) |
| 8 | include(../../deployment.cmake REQUIRED) |
| 9 | |
| 10 | #------------------------------------------------------------------------------- |
| 11 | # Options and variables |
| 12 | #------------------------------------------------------------------------------- |
| 13 | set(BUILD_SHARED_LIBS On CACHE BOOL "Determine if a shared library is being built.") |
| 14 | if(NOT BUILD_SHARED_LIBS) |
| 15 | message(FATAL_ERROR "Building static library is not yet supported. Call cmake with -DBUILD_SHARED_LIBS=1") |
| 16 | endif() |
| 17 | |
| 18 | #------------------------------------------------------------------------------- |
Gabor Toth | ee2e7cb | 2024-10-07 17:02:56 +0200 | [diff] [blame] | 19 | # The CMakeLists.txt for building the libpsats deployment for arm-linux |
Gabor Toth | 172659d | 2023-04-27 08:51:21 +0200 | [diff] [blame] | 20 | # |
Gabor Toth | ee2e7cb | 2024-10-07 17:02:56 +0200 | [diff] [blame] | 21 | # Used for building the libpsats library for the arm-linux environment. Used for |
Gabor Toth | 172659d | 2023-04-27 08:51:21 +0200 | [diff] [blame] | 22 | # locating and accessing services from a Linux userspace client. Service |
| 23 | # instances can be located in any supported secure processing environment. |
| 24 | #------------------------------------------------------------------------------- |
| 25 | include(${TS_ROOT}/environments/arm-linux/env_shared_lib.cmake) |
Gabor Toth | ee2e7cb | 2024-10-07 17:02:56 +0200 | [diff] [blame] | 26 | project(psats LANGUAGES CXX C) |
Gabor Toth | 172659d | 2023-04-27 08:51:21 +0200 | [diff] [blame] | 27 | |
Gabor Toth | ee2e7cb | 2024-10-07 17:02:56 +0200 | [diff] [blame] | 28 | add_library(psats) |
Gabor Toth | 172659d | 2023-04-27 08:51:21 +0200 | [diff] [blame] | 29 | |
Gabor Toth | ee2e7cb | 2024-10-07 17:02:56 +0200 | [diff] [blame] | 30 | target_include_directories(psats PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}") |
Gabor Toth | 172659d | 2023-04-27 08:51:21 +0200 | [diff] [blame] | 31 | |
| 32 | #------------------------------------------------------------------------------- |
| 33 | # For user-specific tracing set to TRACE_LEVEL_NONE and implement: |
| 34 | # void trace_puts(const char *str) |
| 35 | #------------------------------------------------------------------------------- |
| 36 | |
Gabor Toth | ee2e7cb | 2024-10-07 17:02:56 +0200 | [diff] [blame] | 37 | set(TRACE_PREFIX "LIBPSATS" CACHE STRING "Trace prefix") |
Gabor Toth | 172659d | 2023-04-27 08:51:21 +0200 | [diff] [blame] | 38 | set(TRACE_LEVEL "TRACE_LEVEL_DEBUG" CACHE STRING "Trace level") |
| 39 | #------------------------------------------------------------------------------- |
| 40 | # Extend with components that are common across all deployments of |
Gabor Toth | ee2e7cb | 2024-10-07 17:02:56 +0200 | [diff] [blame] | 41 | # libpsats |
Gabor Toth | 172659d | 2023-04-27 08:51:21 +0200 | [diff] [blame] | 42 | # |
| 43 | #------------------------------------------------------------------------------- |
Gabor Toth | ee2e7cb | 2024-10-07 17:02:56 +0200 | [diff] [blame] | 44 | include(../libpsats.cmake REQUIRED) |