Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- Index: userver/cmake/SetupGoogleProtoApis.cmake
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- diff --git a/userver/cmake/SetupGoogleProtoApis.cmake b/userver/cmake/SetupGoogleProtoApis.cmake
- --- a/userver/cmake/SetupGoogleProtoApis.cmake (revision b48f3298f1f418c49e80c15a88ad545ae585539c)
- +++ b/userver/cmake/SetupGoogleProtoApis.cmake (date 1685610867002)
- @@ -52,7 +52,7 @@
- add_library(userver-api-common-protos STATIC ${generated_sources})
- target_compile_options(userver-api-common-protos PUBLIC -Wno-unused-parameter)
- target_include_directories(userver-api-common-protos SYSTEM PUBLIC ${include_paths})
- -target_link_libraries(userver-api-common-protos PUBLIC userver-core userver-grpc-internal-deps)
- +target_link_libraries(userver-api-common-protos PUBLIC userver-core userver-grpc-deps)
- set(api-common-proto_LIBRARY userver-api-common-protos)
- set(api-common-proto_USRV_SOURCES ${generated_usrv_sources})
- Index: userver/grpc/CMakeLists.txt
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- diff --git a/userver/grpc/CMakeLists.txt b/userver/grpc/CMakeLists.txt
- --- a/userver/grpc/CMakeLists.txt (revision b48f3298f1f418c49e80c15a88ad545ae585539c)
- +++ b/userver/grpc/CMakeLists.txt (date 1685610632747)
- @@ -1,5 +1,6 @@
- -project(userver-grpc-internal CXX)
- +project(userver-grpc CXX)
- +include(SetupProtobuf)
- include(GrpcTargets)
- add_library(${PROJECT_NAME}-deps INTERFACE)
- @@ -43,11 +45,11 @@
- list(APPEND SOURCES ${api-common-proto_USRV_SOURCES})
- endif()
- -add_library(${PROJECT_NAME} STATIC ${SOURCES})
- +add_library(${PROJECT_NAME}-internal STATIC ${SOURCES})
- -set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
- +set_target_properties(${PROJECT_NAME}-internal PROPERTIES LINKER_LANGUAGE CXX)
- -target_include_directories(${PROJECT_NAME}
- +target_include_directories(${PROJECT_NAME}-internal
- PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- PRIVATE
- @@ -55,10 +57,10 @@
- )
- if (DEFINED api-common-proto_LIBRARY)
- - target_link_libraries(${PROJECT_NAME} PUBLIC ${api-common-proto_LIBRARY})
- + target_link_libraries(${PROJECT_NAME}-internal PUBLIC ${api-common-proto_LIBRARY})
- endif()
- -target_link_libraries(${PROJECT_NAME} PUBLIC userver-core)
- +target_link_libraries(${PROJECT_NAME}-internal PUBLIC userver-core)
- set(CHANNELZ_MIN_VERSION "1.17.0")
- if (${gRPC_VERSION} VERSION_GREATER_EQUAL ${CHANNELZ_MIN_VERSION})
- @@ -81,15 +83,15 @@
- add_library(gRPC::grpcpp_channelz ALIAS GrpcChannelz)
- endif()
- endif()
- - target_link_libraries(${PROJECT_NAME} PUBLIC gRPC::grpcpp_channelz)
- + target_link_libraries(${PROJECT_NAME}-internal PUBLIC gRPC::grpcpp_channelz)
- else()
- message(STATUS "gRPC Channelz disabled, install gRPC >= ${CHANNELZ_MIN_VERSION} to enable")
- - target_compile_definitions(${PROJECT_NAME} PRIVATE
- + target_compile_definitions(${PROJECT_NAME}-internal PRIVATE
- "USERVER_DISABLE_GRPC_CHANNELZ=1"
- )
- endif()
- -target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_NAME}-deps)
- +target_link_libraries(${PROJECT_NAME}-internal PUBLIC ${PROJECT_NAME}-deps)
- if (USERVER_IS_THE_ROOT_PROJECT)
- add_executable(${PROJECT_NAME}_unittest ${UNIT_TEST_SOURCES})
- @@ -99,7 +101,7 @@
- )
- target_link_libraries(${PROJECT_NAME}_unittest
- PUBLIC
- - ${PROJECT_NAME}
- + ${PROJECT_NAME}-internal
- userver-utest
- PRIVATE
- ${PROJECT_NAME}_unittest_proto
- @@ -113,6 +115,6 @@
- add_subdirectory(handlers)
- -add_library(userver-grpc INTERFACE)
- -target_link_libraries(userver-grpc INTERFACE userver-grpc-handlers)
- -target_link_libraries(userver-grpc INTERFACE userver-grpc-internal)
- +add_library(${PROJECT_NAME} INTERFACE)
- +target_link_libraries(${PROJECT_NAME} INTERFACE ${PROJECT_NAME}-handlers)
- +target_link_libraries(${PROJECT_NAME} INTERFACE ${PROJECT_NAME}-internal)
- Index: userver/cmake/GrpcTargets.cmake
- IDEA additional info:
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
- <+>UTF-8
- ===================================================================
- diff --git a/userver/cmake/GrpcTargets.cmake b/userver/cmake/GrpcTargets.cmake
- --- a/userver/cmake/GrpcTargets.cmake (revision b48f3298f1f418c49e80c15a88ad545ae585539c)
- +++ b/userver/cmake/GrpcTargets.cmake (date 1685610463897)
- @@ -4,17 +4,21 @@
- if (USERVER_CONAN)
- find_package(gRPC REQUIRED)
- - set(GRPC_PROTOBUF_INCLUDE_DIRS "${protobuf_INCLUDE_DIR}")
- + set(USERVER_PROTOBUF_IMPORT_DIR "${protobuf_INCLUDE_DIR}")
- get_target_property(PROTO_GRPC_CPP_PLUGIN gRPC::grpc_cpp_plugin LOCATION)
- get_target_property(PROTO_GRPC_PYTHON_PLUGIN gRPC::grpc_python_plugin LOCATION)
- else()
- - # Use the builtin CMake FindProtobuf
- - set(GRPC_PROTOBUF_INCLUDE_DIRS "${Protobuf_INCLUDE_DIRS}")
- + # Relying on having found Protobuf in root userver CMakeLists.txt
- + if(Protobuf_INCLUDE_DIR)
- + set(USERVER_PROTOBUF_IMPORT_DIR "${Protobuf_INCLUDE_DIR}")
- + else()
- + set(USERVER_PROTOBUF_IMPORT_DIR "${Protobuf_INCLUDE_DIRS}")
- + endif()
- include(SetupGrpc)
- endif()
- -if (NOT GRPC_PROTOBUF_INCLUDE_DIRS)
- +if (NOT USERVER_PROTOBUF_IMPORT_DIR)
- message(FATAL_ERROR "Invalid Protobuf package")
- endif()
- if (NOT gRPC_VERSION)
- @@ -110,7 +114,7 @@
- list(TRANSFORM proto_dependencies_globs APPEND "/*.proto")
- list(APPEND proto_dependencies_globs
- "${root_path}/*.proto"
- - "${GRPC_PROTOBUF_INCLUDE_DIRS}/*.proto"
- + "${USERVER_PROTOBUF_IMPORT_DIR}/*.proto"
- "${USERVER_DIR}/scripts/grpc/*"
- )
- file(GLOB_RECURSE proto_dependencies ${proto_dependencies_globs})
- @@ -151,7 +155,7 @@
- --grpc_python_out=${GENERATED_PROTO_DIR}
- ${pyi_out_param}
- -I ${root_path}
- - -I ${GRPC_PROTOBUF_INCLUDE_DIRS}
- + -I ${USERVER_PROTOBUF_IMPORT_DIR}
- --plugin=protoc-gen-grpc=${PROTO_GRPC_CPP_PLUGIN}
- --plugin=protoc-gen-usrv=${PROTO_GRPC_USRV_PLUGIN}
- --plugin=protoc-gen-grpc_python=${PROTO_GRPC_PYTHON_PLUGIN}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement