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 | |
| 8 | cmake_minimum_required(VERSION 3.15) |
| 9 | cmake_policy(SET CMP0097 NEW) |
| 10 | |
| 11 | # Set eRPC config file. Need to provide config file with an absolute path. |
| 12 | if (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) |
| 18 | else() |
| 19 | # Use default one |
| 20 | set(ERPC_CONFIG_FILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/config") |
| 21 | endif() |
| 22 | |
| 23 | add_library(erpc_server STATIC) |
| 24 | |
| 25 | target_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 Peng | 0eca5ea | 2023-07-21 17:32:31 +0800 | [diff] [blame] | 40 | ${CMAKE_CURRENT_SOURCE_DIR}/../generated_files/tfm_erpc_server.cpp |
Summer Qin | 153f3df | 2022-11-17 15:51:02 +0800 | [diff] [blame] | 41 | ) |
| 42 | |
| 43 | target_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 | |
| 54 | target_link_libraries(erpc_server |
| 55 | PUBLIC |
| 56 | tfm_api_ns |
| 57 | platform_ns # UART driver header and target config |
| 58 | ) |