blob: 20c3c0e1a7f6adbfb893695ebfe560918dc4c724 [file] [log] [blame]
Julian Hallb1d5d5f2020-11-23 18:23:48 +01001#-------------------------------------------------------------------------------
Gyorgy Szingec62ea72022-07-20 12:36:52 +00002# Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
Julian Hallb1d5d5f2020-11-23 18:23:48 +01003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8#-------------------------------------------------------------------------------
9# The base build file shared between deployments of 'libts' for
10# different environments. libts provides a client interface for locating
11# service instances and establishing RPC sessions for using services.
12#-------------------------------------------------------------------------------
13
14#-------------------------------------------------------------------------------
Balint Dobszayb22916e2021-05-26 11:13:00 +020015# Common API version implemented by all libts deployments
16#-------------------------------------------------------------------------------
17version_semver_read(FILE "${CMAKE_CURRENT_LIST_DIR}/version.txt"
18 MAJOR _major MINOR _minor PATCH _patch)
19set_target_properties(ts PROPERTIES VERSION "${_major}.${_minor}.${_patch}")
20set_target_properties(ts PROPERTIES SOVERSION "${_major}")
21unset(_major)
22unset(_minor)
23unset(_patch)
24
Gyorgy Szingec62ea72022-07-20 12:36:52 +000025add_library(libts::ts ALIAS ts)
26
Gabor Tothed8305b2024-09-24 12:47:26 +020027if (COVERAGE)
28 set(LIBTS_BUILD_TYPE "DebugCoverage" CACHE STRING "Build type." FORCE)
29endif()
30
Balint Dobszayb22916e2021-05-26 11:13:00 +020031#-------------------------------------------------------------------------------
Gyorgy Szingec62ea72022-07-20 12:36:52 +000032# Components that are common across all deployments
Julian Hallb1d5d5f2020-11-23 18:23:48 +010033#
34#-------------------------------------------------------------------------------
35add_components(
36 TARGET "ts"
37 BASE_DIR ${TS_ROOT}
38 COMPONENTS
Gabor Tothed8305b2024-09-24 12:47:26 +020039 "environments/${TS_ENV}"
40 "components/common/trace"
Julian Hallb1d5d5f2020-11-23 18:23:48 +010041 "components/rpc/common/caller"
42 "components/rpc/common/interface"
43 "components/service/locator"
44 "components/service/locator/interface"
45)
46
47#-------------------------------------------------------------------------------
48# Define public interfaces for library
49#
50#-------------------------------------------------------------------------------
51
52# Enable exporting interface symbols for library public interface
53target_compile_definitions(ts PRIVATE
Gabor Tothed8305b2024-09-24 12:47:26 +020054 EXPORT_PUBLIC_INTERFACE_TRACE
Julian Hallb1d5d5f2020-11-23 18:23:48 +010055 EXPORT_PUBLIC_INTERFACE_RPC_CALLER
Imre Kis1ff7a522023-07-26 12:41:02 +020056 EXPORT_PUBLIC_INTERFACE_RPC_SERVICE
Julian Hallb1d5d5f2020-11-23 18:23:48 +010057 EXPORT_PUBLIC_INTERFACE_SERVICE_LOCATOR
58)
59
Balint Dobszay26be9aa2023-05-08 17:56:55 +020060# Do not export symbols from static libraries linked to this library
61target_link_options(ts PRIVATE -Wl,--exclude-libs,ALL)
62
Julian Hallb1d5d5f2020-11-23 18:23:48 +010063#-------------------------------------------------------------------------------
64# Export the library and the corresponding public interface header files
65#
66#-------------------------------------------------------------------------------
67include(${TS_ROOT}/tools/cmake/common/ExportLibrary.cmake REQUIRED)
68
Julian Hallb1d5d5f2020-11-23 18:23:48 +010069# Exports library information in preparation for install
70export_library(
71 TARGET "ts"
72 LIB_NAME "libts"
Gyorgy Szingec62ea72022-07-20 12:36:52 +000073 PKG_CONFIG_FILE "${CMAKE_CURRENT_LIST_DIR}/libtsConfig.cmake.in"
Julian Hallb1d5d5f2020-11-23 18:23:48 +010074)