Julian Hall | b1d5d5f | 2020-11-23 18:23:48 +0100 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
Gyorgy Szing | ec62ea7 | 2022-07-20 12:36:52 +0000 | [diff] [blame] | 2 | # Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved. |
Julian Hall | b1d5d5f | 2020-11-23 18:23:48 +0100 | [diff] [blame] | 3 | # |
| 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 Dobszay | b22916e | 2021-05-26 11:13:00 +0200 | [diff] [blame] | 15 | # Common API version implemented by all libts deployments |
| 16 | #------------------------------------------------------------------------------- |
| 17 | version_semver_read(FILE "${CMAKE_CURRENT_LIST_DIR}/version.txt" |
| 18 | MAJOR _major MINOR _minor PATCH _patch) |
| 19 | set_target_properties(ts PROPERTIES VERSION "${_major}.${_minor}.${_patch}") |
| 20 | set_target_properties(ts PROPERTIES SOVERSION "${_major}") |
| 21 | unset(_major) |
| 22 | unset(_minor) |
| 23 | unset(_patch) |
| 24 | |
Gyorgy Szing | ec62ea7 | 2022-07-20 12:36:52 +0000 | [diff] [blame] | 25 | add_library(libts::ts ALIAS ts) |
| 26 | |
Gabor Toth | ed8305b | 2024-09-24 12:47:26 +0200 | [diff] [blame^] | 27 | if (COVERAGE) |
| 28 | set(LIBTS_BUILD_TYPE "DebugCoverage" CACHE STRING "Build type." FORCE) |
| 29 | endif() |
| 30 | |
Balint Dobszay | b22916e | 2021-05-26 11:13:00 +0200 | [diff] [blame] | 31 | #------------------------------------------------------------------------------- |
Gyorgy Szing | ec62ea7 | 2022-07-20 12:36:52 +0000 | [diff] [blame] | 32 | # Components that are common across all deployments |
Julian Hall | b1d5d5f | 2020-11-23 18:23:48 +0100 | [diff] [blame] | 33 | # |
| 34 | #------------------------------------------------------------------------------- |
| 35 | add_components( |
| 36 | TARGET "ts" |
| 37 | BASE_DIR ${TS_ROOT} |
| 38 | COMPONENTS |
Gabor Toth | ed8305b | 2024-09-24 12:47:26 +0200 | [diff] [blame^] | 39 | "environments/${TS_ENV}" |
| 40 | "components/common/trace" |
Julian Hall | b1d5d5f | 2020-11-23 18:23:48 +0100 | [diff] [blame] | 41 | "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 |
| 53 | target_compile_definitions(ts PRIVATE |
Gabor Toth | ed8305b | 2024-09-24 12:47:26 +0200 | [diff] [blame^] | 54 | EXPORT_PUBLIC_INTERFACE_TRACE |
Julian Hall | b1d5d5f | 2020-11-23 18:23:48 +0100 | [diff] [blame] | 55 | EXPORT_PUBLIC_INTERFACE_RPC_CALLER |
Imre Kis | 1ff7a52 | 2023-07-26 12:41:02 +0200 | [diff] [blame] | 56 | EXPORT_PUBLIC_INTERFACE_RPC_SERVICE |
Julian Hall | b1d5d5f | 2020-11-23 18:23:48 +0100 | [diff] [blame] | 57 | EXPORT_PUBLIC_INTERFACE_SERVICE_LOCATOR |
| 58 | ) |
| 59 | |
Balint Dobszay | 26be9aa | 2023-05-08 17:56:55 +0200 | [diff] [blame] | 60 | # Do not export symbols from static libraries linked to this library |
| 61 | target_link_options(ts PRIVATE -Wl,--exclude-libs,ALL) |
| 62 | |
Julian Hall | b1d5d5f | 2020-11-23 18:23:48 +0100 | [diff] [blame] | 63 | #------------------------------------------------------------------------------- |
| 64 | # Export the library and the corresponding public interface header files |
| 65 | # |
| 66 | #------------------------------------------------------------------------------- |
| 67 | include(${TS_ROOT}/tools/cmake/common/ExportLibrary.cmake REQUIRED) |
| 68 | |
Julian Hall | b1d5d5f | 2020-11-23 18:23:48 +0100 | [diff] [blame] | 69 | # Exports library information in preparation for install |
| 70 | export_library( |
| 71 | TARGET "ts" |
| 72 | LIB_NAME "libts" |
Gyorgy Szing | ec62ea7 | 2022-07-20 12:36:52 +0000 | [diff] [blame] | 73 | PKG_CONFIG_FILE "${CMAKE_CURRENT_LIST_DIR}/libtsConfig.cmake.in" |
Julian Hall | b1d5d5f | 2020-11-23 18:23:48 +0100 | [diff] [blame] | 74 | ) |