-
Notifications
You must be signed in to change notification settings - Fork 82
/
CMakeLists.txt
39 lines (31 loc) · 1.39 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
#
# Tencent is pleased to support the open source community by making tRPC available.
#
# Copyright (C) 2023 THL A29 Limited, a Tencent company.
# All rights reserved.
#
# If you have downloaded a copy of the tRPC source code from Tencent,
# please note that tRPC source code is licensed under the Apache 2.0 License,
# A copy of the Apache 2.0 License is included in this file.
#
#
cmake_minimum_required(VERSION 3.14)
include(../cmake/common.cmake)
#---------------------------------------------------------------------------------------
# Compile project
#---------------------------------------------------------------------------------------
project(features_trpc_attachment)
# compile proto
set(PB_SRC ${TRPC_ROOT_PATH}/examples/helloworld/helloworld.proto)
COMPILE_PROTO(OUT_PB_SRCS "${PB_SRC}" ${PB_PROTOC} ${TRPC_ROOT_PATH})
TRPC_COMPILE_PROTO(OUT_TRPC_PB_SRCS "${PB_SRC}" ${PB_PROTOC} ${TRPC_CPP_PLUGIN} ${TRPC_ROOT_PATH})
# compile server
file(GLOB SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/server/*.cc
${TRPC_ROOT_PATH}/examples/helloworld/greeter_service.cc)
add_executable(demo_server ${SRC_FILES} ${OUT_PB_SRCS} ${OUT_TRPC_PB_SRCS})
target_link_libraries(demo_server ${LIBRARY})
# compile client
file(GLOB SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/client/*.cc)
add_executable(client ${SRC_FILES} ${SRC_FILES} ${OUT_PB_SRCS} ${OUT_TRPC_PB_SRCS})
target_link_libraries(client ${LIBRARY})