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 | #------------------------------------------------------------------------------- |
| 19 | # The CMakeLists.txt for building the libpsa deployment for arm-linux |
| 20 | # |
| 21 | # Used for building the libpsa library for the arm-linux environment. Used for |
| 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/linux-pc/env_shared_lib.cmake) |
| 26 | project(psa LANGUAGES CXX C) |
| 27 | |
| 28 | add_library(psa) |
| 29 | |
| 30 | target_include_directories(psa PRIVATE "${TOP_LEVEL_INCLUDE_DIRS}") |
| 31 | |
| 32 | #------------------------------------------------------------------------------- |
| 33 | # For user-specific tracing set to TRACE_LEVEL_NONE and implement: |
| 34 | # void trace_puts(const char *str) |
| 35 | #------------------------------------------------------------------------------- |
| 36 | |
| 37 | set(TRACE_PREFIX "LIBPSA" CACHE STRING "Trace prefix") |
| 38 | set(TRACE_LEVEL "TRACE_LEVEL_DEBUG" CACHE STRING "Trace level") |
| 39 | #------------------------------------------------------------------------------- |
| 40 | # Extend with components that are common across all deployments of |
| 41 | # libpsa |
| 42 | # |
| 43 | #------------------------------------------------------------------------------- |
| 44 | include(../libpsa.cmake REQUIRED) |