blob: e4e5ce4919871672bbbc2df74b6df69bdd929b7f [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
David Hu4c3c0ca2023-12-02 22:09:18 +08008cmake_minimum_required(VERSION 3.21)
Summer Qin153f3df2022-11-17 15:51:02 +08009
10# Set eRPC config file. Need to provide config file with an absolute path.
11if (ERPC_CONFIG_FILE)
12 if (NOT EXISTS ${ERPC_CONFIG_FILE})
13 message(FATAL_ERROR "ERPC_CONFIG_FILE does not exist. Please provide it with an absolute path.")
14 endif()
15 # Get the path of the customized eRPC config file
16 get_filename_component(ERPC_CONFIG_FILE_PATH ${ERPC_CONFIG_FILE} DIRECTORY)
17else()
18 # Use default one
19 set(ERPC_CONFIG_FILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config")
20endif()
21
22add_library(erpc_server STATIC)
23
24target_sources(erpc_server
25 PRIVATE
26 erpc_server_start.c
27 erpc_server_wrapper.c
28 # eRPC files
29 ${ERPC_REPO_PATH}/erpc_c/infra/erpc_basic_codec.cpp
30 ${ERPC_REPO_PATH}/erpc_c/infra/erpc_crc16.cpp
31 ${ERPC_REPO_PATH}/erpc_c/infra/erpc_framed_transport.cpp
32 ${ERPC_REPO_PATH}/erpc_c/infra/erpc_message_buffer.cpp
33 ${ERPC_REPO_PATH}/erpc_c/infra/erpc_server.cpp
34 ${ERPC_REPO_PATH}/erpc_c/infra/erpc_simple_server.cpp
35 ${ERPC_REPO_PATH}/erpc_c/port/erpc_port_stdlib.cpp
36 ${ERPC_REPO_PATH}/erpc_c/setup/erpc_setup_mbf_dynamic.cpp
37 ${ERPC_REPO_PATH}/erpc_c/setup/erpc_server_setup.cpp
38 # Generated files
Kevin Peng0eca5ea2023-07-21 17:32:31 +080039 ${CMAKE_CURRENT_SOURCE_DIR}/../generated_files/tfm_erpc_server.cpp
Summer Qin153f3df2022-11-17 15:51:02 +080040)
41
42target_include_directories(erpc_server
43 PUBLIC
44 ${ERPC_REPO_PATH}/erpc_c/port
45 ${ERPC_REPO_PATH}/erpc_c/infra
46 ${ERPC_REPO_PATH}/erpc_c/transports
47 ${ERPC_REPO_PATH}/erpc_c/setup
48 ${CMAKE_CURRENT_SOURCE_DIR}/
49 ${CMAKE_CURRENT_SOURCE_DIR}/../generated_files
50 ${ERPC_CONFIG_FILE_PATH}/
51)
52
53target_link_libraries(erpc_server
54 PUBLIC
55 tfm_api_ns
56 platform_ns # UART driver header and target config
57)