fix bug when build core only

This commit is contained in:
jsonwu 2025-01-23 13:08:51 +08:00
parent 216b86f8d7
commit 27d96a2947
3 changed files with 8 additions and 1 deletions

3
.gitignore vendored
View File

@ -4,5 +4,8 @@ proto/**/*.pb.cc
proto/**/*.pb.h proto/**/*.pb.h
default.etcd/ default.etcd/
# vscode
.vscode/
# vscode-clangd # vscode-clangd
.cache/ .cache/

View File

@ -15,7 +15,7 @@ if(NOT gRPC_FOUND)
find_dependency(GRPC) find_dependency(GRPC)
endif() endif()
find_dependency(cpprestsdk) find_package(cpprestsdk QUIET)
if(cpprestsdk_FOUND) if(cpprestsdk_FOUND)
set(CPPREST_LIB cpprestsdk::cpprest) set(CPPREST_LIB cpprestsdk::cpprest)
endif() endif()

View File

@ -17,6 +17,10 @@ file(GLOB_RECURSE CPP_CLIENT_CORE_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp"
) )
if(BUILD_ETCD_CORE_ONLY)
list(REMOVE_ITEM CPP_CLIENT_CORE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/Client.cpp")
endif()
add_library(etcd-cpp-api-core-objects OBJECT ${CPP_CLIENT_CORE_SRC} ${PROTOBUF_GENERATES}) add_library(etcd-cpp-api-core-objects OBJECT ${CPP_CLIENT_CORE_SRC} ${PROTOBUF_GENERATES})
use_cxx(etcd-cpp-api-core-objects) use_cxx(etcd-cpp-api-core-objects)
set_exceptions(etcd-cpp-api-core-objects) set_exceptions(etcd-cpp-api-core-objects)