mirror of
https://git.proxmox.com/git/llvm-toolchain
synced 2025-07-27 00:58:16 +00:00
improve the libgrpc++ patch for backports
This commit is contained in:
parent
0fafb7f1a7
commit
ca1e03b5ca
22
debian/patches/link-grpc.diff
vendored
22
debian/patches/link-grpc.diff
vendored
@ -2,7 +2,7 @@ Index: llvm-toolchain-14-14.0.6/llvm/cmake/modules/FindGRPC.cmake
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- llvm-toolchain-14-14.0.6.orig/llvm/cmake/modules/FindGRPC.cmake
|
--- llvm-toolchain-14-14.0.6.orig/llvm/cmake/modules/FindGRPC.cmake
|
||||||
+++ llvm-toolchain-14-14.0.6/llvm/cmake/modules/FindGRPC.cmake
|
+++ llvm-toolchain-14-14.0.6/llvm/cmake/modules/FindGRPC.cmake
|
||||||
@@ -73,10 +73,27 @@ else()
|
@@ -73,10 +73,29 @@ else()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -23,19 +23,29 @@ Index: llvm-toolchain-14-14.0.6/llvm/cmake/modules/FindGRPC.cmake
|
|||||||
+ set_target_properties(grpc PROPERTIES IMPORTED_LOCATION ${GRPC2_LIBRARY})
|
+ set_target_properties(grpc PROPERTIES IMPORTED_LOCATION ${GRPC2_LIBRARY})
|
||||||
+
|
+
|
||||||
+ find_library(ABSL_SYNCHRONIZATION_LIBRARY absl_synchronization $GRPC_OPTS REQUIRED)
|
+ find_library(ABSL_SYNCHRONIZATION_LIBRARY absl_synchronization $GRPC_OPTS REQUIRED)
|
||||||
+ add_library(absl_synchronization UNKNOWN IMPORTED GLOBAL)
|
+ if (ABSL_SYNCHRONIZATION_LIBRARY)
|
||||||
+ message(STATUS "Using absl_synchronization: " ${ABSL_SYNCHRONIZATION_LIBRARY})
|
+ add_library(absl_synchronization UNKNOWN IMPORTED GLOBAL)
|
||||||
+ set_target_properties(absl_synchronization PROPERTIES IMPORTED_LOCATION ${ABSL_SYNCHRONIZATION_LIBRARY})
|
+ message(STATUS "Using absl_synchronization: " ${ABSL_SYNCHRONIZATION_LIBRARY})
|
||||||
|
+ set_target_properties(absl_synchronization PROPERTIES IMPORTED_LOCATION ${ABSL_SYNCHRONIZATION_LIBRARY})
|
||||||
|
+ endif()
|
||||||
+
|
+
|
||||||
if (ENABLE_GRPC_REFLECTION)
|
if (ENABLE_GRPC_REFLECTION)
|
||||||
find_library(GRPC_REFLECTION_LIBRARY grpc++_reflection $GRPC_OPTS REQUIRED)
|
find_library(GRPC_REFLECTION_LIBRARY grpc++_reflection $GRPC_OPTS REQUIRED)
|
||||||
add_library(grpc++_reflection UNKNOWN IMPORTED GLOBAL)
|
add_library(grpc++_reflection UNKNOWN IMPORTED GLOBAL)
|
||||||
@@ -123,7 +140,7 @@ function(generate_protos LibraryName Pro
|
@@ -121,9 +140,15 @@ function(generate_protos LibraryName Pro
|
||||||
|
ARGS ${Flags} "${ProtoSourceAbsolutePath}"
|
||||||
|
DEPENDS "${ProtoSourceAbsolutePath}")
|
||||||
|
|
||||||
|
+ set(LINKED_GRPC_LIBRARIES protobuf gpr grpc grpc++)
|
||||||
|
+
|
||||||
|
+ if (ABSL_SYNCHRONIZATION_LIBRARY)
|
||||||
|
+ list(APPEND LINKED_GRPC_LIBRARIES absl_synchronization)
|
||||||
|
+ endif()
|
||||||
|
+
|
||||||
add_clang_library(${LibraryName} ${GeneratedProtoSource}
|
add_clang_library(${LibraryName} ${GeneratedProtoSource}
|
||||||
PARTIAL_SOURCES_INTENDED
|
PARTIAL_SOURCES_INTENDED
|
||||||
- LINK_LIBS PUBLIC grpc++ protobuf)
|
- LINK_LIBS PUBLIC grpc++ protobuf)
|
||||||
+ LINK_LIBS PUBLIC protobuf gpr grpc absl_synchronization grpc++)
|
+ LINK_LIBS PUBLIC ${LINKED_GRPC_LIBRARIES})
|
||||||
|
|
||||||
# Ensure dependency headers are generated before dependent protos are built.
|
# Ensure dependency headers are generated before dependent protos are built.
|
||||||
# DEPENDS arg is a list of "Foo.proto". While they're logically relative to
|
# DEPENDS arg is a list of "Foo.proto". While they're logically relative to
|
||||||
|
Loading…
Reference in New Issue
Block a user