This commit is contained in:
waruto 2025-03-28 10:59:04 +08:00 committed by GitHub
commit 7897251831
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 3 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,9 +15,11 @@ if(NOT gRPC_FOUND)
find_dependency(GRPC) find_dependency(GRPC)
endif() endif()
find_dependency(cpprestsdk) if (NOT @BUILD_ETCD_CORE_ONLY@)
if(cpprestsdk_FOUND) find_dependency(cpprestsdk)
set(CPPREST_LIB cpprestsdk::cpprest) if(cpprestsdk_FOUND)
set(CPPREST_LIB cpprestsdk::cpprest)
endif()
endif() endif()
set(ETCD_CPP_HOME "${CMAKE_CURRENT_LIST_DIR}/../../..") set(ETCD_CPP_HOME "${CMAKE_CURRENT_LIST_DIR}/../../..")

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)