2023-12-02 00:32:54 +08:00
|
|
|
cmake_minimum_required(VERSION 3.26)
|
|
|
|
project(crpc)
|
|
|
|
|
|
|
|
find_package(antlr4-runtime CONFIG REQUIRED)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
|
|
|
FILE(GLOB_RECURSE SRC_LIST ${PROJECT_SOURCE_DIR}/src/*.cpp)
|
|
|
|
add_executable(crpc
|
2023-12-02 08:45:42 +08:00
|
|
|
${SRC_LIST}
|
2023-12-02 00:32:54 +08:00
|
|
|
main.cpp
|
|
|
|
src/item.cpp
|
|
|
|
src/message.cpp
|
|
|
|
src/rpc.cpp
|
|
|
|
src/service.cpp
|
|
|
|
src/plugins/c/c_message_plugin.cpp
|
2023-12-02 08:45:42 +08:00
|
|
|
src/plugins/c/items/c_item.cpp
|
|
|
|
src/plugins/service_plugin.cpp
|
|
|
|
src/plugins/plugin.cpp
|
|
|
|
src/plugins/c/c_service_server_plugin.cpp
|
|
|
|
src/plugins/c/rpcs/crpc_client.cpp
|
|
|
|
src/plugins/c/rpcs/crpc.cpp
|
|
|
|
src/plugins/c/c_service_plugin.cpp
|
2023-12-02 00:32:54 +08:00
|
|
|
)
|
|
|
|
target_link_libraries(crpc PRIVATE antlr4_static)
|
|
|
|
target_include_directories(crpc PRIVATE /opt/dev/vcpkg/installed/arm64-osx/include/antlr4-runtime)
|
2023-12-03 08:04:44 +08:00
|
|
|
target_include_directories(crpc PRIVATE src/grammar/ src/)
|
2023-12-02 00:32:54 +08:00
|
|
|
|
2023-12-03 08:04:44 +08:00
|
|
|
FILE(GLOB_RECURSE TEST_SRC_LIST ${CMAKE_CURRENT_BINARY_DIR}/grammar/*.c)
|
2023-12-02 11:05:25 +08:00
|
|
|
add_executable(test ${TEST_SRC_LIST}
|
|
|
|
test/test.c
|
|
|
|
)
|
|
|
|
target_include_directories(test PRIVATE
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/3party/tpl
|
|
|
|
)
|