kumquat-buildroot/package/grpc/0004-host-grpc-only-cpp-plugin.patch
Fabrice Fontaine 9f22134430 package/grpc: fix fourth patch
Fix the following build failure raised since the addition of fourth
patch in commit 8251d8c255:

1 out of 22 hunks FAILED -- saving rejects to file CMakeLists.txt.rej

Fixes:
 - http://autobuild.buildroot.org/results/44f6d7c61316e90d22e75cb1fb77c3bc5b31ad66

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2022-02-13 15:44:04 +01:00

216 lines
5.8 KiB
Diff

From a1922eadfc87da3dd221ff631f94ddd4a8ee7049 Mon Sep 17 00:00:00 2001
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Date: Tue, 25 May 2021 14:55:23 +0200
Subject: [PATCH] Add option to restrict building of (host-)grpc to
grpc_cpp_plugin only.
This avoids unnecessary dependencies on big packages like libabseil-cpp and
others.
Upstream-status: not accepted (see https://github.com/grpc/grpc/issues/25322)
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
CMakeLists.txt | 43 +++++++++++++++++++++++++++++++++++--------
1 file changed, 35 insertions(+), 8 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e8934a3e03..c2df332cc6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,12 +48,16 @@ option(gRPC_BUILD_TESTS "Build tests" OFF)
option(gRPC_BUILD_CODEGEN "Build codegen" ON)
option(gRPC_BUILD_CSHARP_EXT "Build C# extensions" ON)
option(gRPC_BACKWARDS_COMPATIBILITY_MODE "Build libraries that are binary compatible across a larger number of OS and libc versions" OFF)
+option(gRPC_BUILD_PLUGIN_SUPPORT_ONLY "Build plugin support only" OFF)
set(gRPC_INSTALL_default ON)
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# Disable gRPC_INSTALL by default if building as a submodule
set(gRPC_INSTALL_default OFF)
endif()
+if(gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+ set(gRPC_INSTALL_default OFF)
+endif()
set(gRPC_INSTALL ${gRPC_INSTALL_default} CACHE BOOL
"Generate installation target")
@@ -367,6 +371,8 @@ add_custom_target(plugins
DEPENDS ${_gRPC_PLUGIN_LIST}
)
+if (NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+
add_custom_target(tools_c
DEPENDS
check_epollexclusive
@@ -382,6 +388,8 @@ add_custom_target(tools_cxx
add_custom_target(tools
DEPENDS tools_c tools_cxx)
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
+
protobuf_generate_grpc_cpp(
src/proto/grpc/channelz/channelz.proto
)
@@ -1000,6 +1008,7 @@ if(gRPC_BUILD_TESTS)
DEPENDS buildtests_c buildtests_cxx)
endif()
+if (NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
add_library(address_sorting
third_party/address_sorting/address_sorting.c
@@ -1051,6 +1060,8 @@ if(gRPC_INSTALL)
)
endif()
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
+
if(gRPC_BUILD_TESTS)
add_library(end2end_nosec_tests
@@ -1313,6 +1324,8 @@ target_link_libraries(end2end_tests
endif()
+if(NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+
add_library(gpr
src/core/lib/gpr/alloc.cc
src/core/lib/gpr/atm.cc
@@ -2106,6 +2119,8 @@ if(gRPC_INSTALL)
)
endif()
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
+
if(gRPC_BUILD_CSHARP_EXT)
add_library(grpc_csharp_ext SHARED
@@ -2288,6 +2303,8 @@ endif()
endif()
+if(NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+
add_library(grpc_unsecure
src/core/ext/filters/census/grpc_context.cc
src/core/ext/filters/client_channel/backend_metric.cc
@@ -2650,6 +2667,8 @@ if(gRPC_INSTALL)
)
endif()
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
+
if(gRPC_BUILD_TESTS)
if(gRPC_BUILD_CODEGEN)
@@ -2717,6 +2736,8 @@ endif()
endif()
+if(NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+
add_library(grpc++
src/cpp/client/channel_cc.cc
src/cpp/client/client_callback.cc
@@ -3134,6 +3155,7 @@ if(gRPC_INSTALL)
)
endif()
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
if(gRPC_BUILD_CODEGEN)
add_library(grpc++_reflection
@@ -3374,6 +3396,8 @@ target_link_libraries(grpc++_test_util
endif()
+if(NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+
add_library(grpc++_unsecure
src/cpp/client/channel_cc.cc
src/cpp/client/client_callback.cc
@@ -3656,6 +3680,7 @@ if(gRPC_INSTALL)
)
endif()
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
add_library(grpc_plugin_support
src/compiler/cpp_generator.cc
@@ -3715,7 +3740,7 @@ foreach(_hdr
endforeach()
-if(gRPC_INSTALL)
+if(gRPC_INSTALL OR gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
install(TARGETS grpc_plugin_support EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
@@ -3795,6 +3820,8 @@ endif()
endif()
+if(NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
+
add_library(upb
third_party/upb/upb/decode_fast.c
third_party/upb/upb/decode.c
@@ -3852,8 +3879,6 @@ if(gRPC_INSTALL)
)
endif()
-
-
add_executable(check_epollexclusive
test/build/check_epollexclusive.c
)
@@ -3958,6 +3981,8 @@ target_link_libraries(gen_percent_encoding_tables
${_gRPC_ALLTARGETS_LIBRARIES}
)
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
+
if(gRPC_BUILD_TESTS)
@@ -10722,7 +10747,7 @@ target_link_libraries(grpc_cli
endif()
-if(gRPC_BUILD_CODEGEN AND gRPC_BUILD_GRPC_CPP_PLUGIN)
+if(gRPC_BUILD_GRPC_CPP_PLUGIN)
add_executable(grpc_cpp_plugin
src/compiler/cpp_plugin.cc
@@ -10752,7 +10777,7 @@ target_link_libraries(grpc_cpp_plugin
-if(gRPC_INSTALL)
+if(gRPC_INSTALL OR gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
install(TARGETS grpc_cpp_plugin EXPORT gRPCTargets
RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR}
LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR}
@@ -15420,7 +15445,7 @@ endif()
-
+if (NOT gRPC_BUILD_PLUGIN_SUPPORT_ONLY)
if(gRPC_INSTALL)
install(EXPORT gRPCTargets
@@ -15517,3 +15542,5 @@ generate_pkgconfig(
"-lgrpc++_unsecure -labsl_statusor -labsl_status -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_synchronization -labsl_time -labsl_time_zone -labsl_civil_time -labsl_graphcycles_internal -labsl_symbolize -labsl_demangle_internal -labsl_malloc_internal -labsl_stacktrace -labsl_debugging_internal -labsl_exponential_biased -labsl_cord -labsl_str_format_internal -labsl_hash -labsl_bad_variant_access -labsl_bad_optional_access -labsl_strings -labsl_strings_internal -labsl_base -labsl_spinlock_wait -labsl_int128 -labsl_city -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity"
""
"grpc++_unsecure.pc")
+
+endif() # gRPC_BUILD_PLUGIN_SUPPORT_ONLY
--
2.26.3