Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 1 | #------------------------------------------------------------------------------- |
| 2 | # Copyright (c) 2023, Arm Limited. All rights reserved. |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | # |
| 6 | #------------------------------------------------------------------------------- |
| 7 | |
David Hu | 4c3c0ca | 2023-12-02 22:09:18 +0800 | [diff] [blame] | 8 | cmake_minimum_required(VERSION 3.21) |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 9 | |
| 10 | # Set eRPC config file. Need to provide config file with an absolute path. |
| 11 | if (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) |
| 17 | else() |
| 18 | # Use default one |
| 19 | set(ERPC_CONFIG_FILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config") |
| 20 | endif() |
| 21 | |
| 22 | add_library(erpc_server STATIC) |
| 23 | |
| 24 | target_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 Peng | 0eca5ea | 2023-07-21 17:32:31 +0800 | [diff] [blame] | 39 | ${CMAKE_CURRENT_SOURCE_DIR}/../generated_files/tfm_erpc_server.cpp |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 40 | ) |
| 41 | |
| 42 | target_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 | |
| 53 | target_link_libraries(erpc_server |
| 54 | PUBLIC |
| 55 | tfm_api_ns |
| 56 | platform_ns # UART driver header and target config |
| 57 | ) |