blob: 7d45a3678a0f366a2cf09a224708f44291bceb3f [file] [log] [blame]
Gabor Toth172659d2023-04-27 08:51:21 +02001#-------------------------------------------------------------------------------
2# Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
8include(../../deployment.cmake REQUIRED)
9
10#-------------------------------------------------------------------------------
11# Options and variables
12#-------------------------------------------------------------------------------
13set(BUILD_SHARED_LIBS On CACHE BOOL "Determine if a shared library is being built.")
14if(NOT BUILD_SHARED_LIBS)
15 message(FATAL_ERROR "Building static library is not yet supported. Call cmake with -DBUILD_SHARED_LIBS=1")
16endif()
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#-------------------------------------------------------------------------------
25include(${TS_ROOT}/environments/linux-pc/env_shared_lib.cmake)
26project(psa LANGUAGES CXX C)
27
28add_library(psa)
29
30target_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
37set(TRACE_PREFIX "LIBPSA" CACHE STRING "Trace prefix")
38set(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#-------------------------------------------------------------------------------
44include(../libpsa.cmake REQUIRED)