blob: 8e432958d8f96a879286481678c7ee7566544baf [file] [log] [blame]
Summer Qin153f3df2022-11-17 15:51:02 +08001#-------------------------------------------------------------------------------
2# Copyright (c) 2023, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6#-------------------------------------------------------------------------------
7
8cmake_minimum_required(VERSION 3.15)
9cmake_policy(SET CMP0097 NEW)
10
11# Set eRPC config file. Need to provide config file with an absolute path.
12if (ERPC_CONFIG_FILE)
13 if (NOT EXISTS ${ERPC_CONFIG_FILE})
14 message(FATAL_ERROR "ERPC_CONFIG_FILE does not exist. Please provide it with an absolute path.")
15 endif()
16 # Get the path of the customized eRPC config file
17 get_filename_component(ERPC_CONFIG_FILE_PATH ${ERPC_CONFIG_FILE} DIRECTORY)
18else()
19 # Use default one
20 set(ERPC_CONFIG_FILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config")
21endif()
22
23add_library(erpc_server STATIC)
24
25target_sources(erpc_server
26 PRIVATE
27 erpc_server_start.c
28 erpc_server_wrapper.c
29 # eRPC files
30 ${ERPC_REPO_PATH}/erpc_c/infra/erpc_basic_codec.cpp
31 ${ERPC_REPO_PATH}/erpc_c/infra/erpc_crc16.cpp
32 ${ERPC_REPO_PATH}/erpc_c/infra/erpc_framed_transport.cpp
33 ${ERPC_REPO_PATH}/erpc_c/infra/erpc_message_buffer.cpp
34 ${ERPC_REPO_PATH}/erpc_c/infra/erpc_server.cpp
35 ${ERPC_REPO_PATH}/erpc_c/infra/erpc_simple_server.cpp
36 ${ERPC_REPO_PATH}/erpc_c/port/erpc_port_stdlib.cpp
37 ${ERPC_REPO_PATH}/erpc_c/setup/erpc_setup_mbf_dynamic.cpp
38 ${ERPC_REPO_PATH}/erpc_c/setup/erpc_server_setup.cpp
39 # Generated files
Kevin Peng0eca5ea2023-07-21 17:32:31 +080040 ${CMAKE_CURRENT_SOURCE_DIR}/../generated_files/tfm_erpc_server.cpp
Summer Qin153f3df2022-11-17 15:51:02 +080041)
42
43target_include_directories(erpc_server
44 PUBLIC
45 ${ERPC_REPO_PATH}/erpc_c/port
46 ${ERPC_REPO_PATH}/erpc_c/infra
47 ${ERPC_REPO_PATH}/erpc_c/transports
48 ${ERPC_REPO_PATH}/erpc_c/setup
49 ${CMAKE_CURRENT_SOURCE_DIR}/
50 ${CMAKE_CURRENT_SOURCE_DIR}/../generated_files
51 ${ERPC_CONFIG_FILE_PATH}/
52)
53
54target_link_libraries(erpc_server
55 PUBLIC
56 tfm_api_ns
57 platform_ns # UART driver header and target config
58)