This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 601e3c62c3 GH-36511: [C++][FlightRPC] Get rid of GRPCPP_PP_INCLUDE
(#36679)
601e3c62c3 is described below
commit 601e3c62c358e6a9204cc38fba59f58b5628a1b4
Author: Sutou Kouhei <[email protected]>
AuthorDate: Fri Jul 14 16:38:22 2023 +0900
GH-36511: [C++][FlightRPC] Get rid of GRPCPP_PP_INCLUDE (#36679)
### Rationale for this change
It's for gRPC < 1.10 and we require gRPC >= 1.30.0. So we can get rid of it.
### What changes are included in this PR?
Get rid of GRPCPP_PP_INCLUDE.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
No.
* Closes: #36511
Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
cpp/cmake_modules/ThirdpartyToolchain.cmake | 13 -------------
cpp/src/arrow/flight/flight_test.cc | 4 ----
cpp/src/arrow/flight/transport/grpc/customize_grpc.h | 9 ---------
cpp/src/arrow/flight/transport/grpc/grpc_client.cc | 5 -----
cpp/src/arrow/flight/transport/grpc/grpc_server.cc | 5 -----
.../arrow/flight/transport/grpc/serialization_internal.cc | 5 -----
cpp/src/arrow/flight/transport/grpc/util_internal.cc | 4 ----
cpp/src/arrow/util/config.h.cmake | 2 --
8 files changed, 47 deletions(-)
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 6488ac13cb..9b7dd8b80c 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -3998,7 +3998,6 @@ if(ARROW_WITH_GRPC)
if(GRPC_VENDORED)
# Remove "v" from "vX.Y.Z"
string(SUBSTRING ${ARROW_GRPC_BUILD_VERSION} 1 -1 ARROW_GRPC_VERSION)
- set(GRPCPP_PP_INCLUDE TRUE)
# Examples need to link to static Arrow if we're using static gRPC
set(ARROW_GRPC_USE_SHARED OFF)
else()
@@ -4007,18 +4006,6 @@ if(ARROW_WITH_GRPC)
else()
set(ARROW_GRPC_VERSION ${gRPC_VERSION})
endif()
- # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or
${GRPC_INCLUDE_DIR}/grpcpp
- # depending on the gRPC version.
- get_target_property(GRPC_INCLUDE_DIR gRPC::grpc++
INTERFACE_INCLUDE_DIRECTORIES)
- if(GRPC_INCLUDE_DIR MATCHES "^\\$<"
- OR # generator expression
- EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h")
- set(GRPCPP_PP_INCLUDE TRUE)
- elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h")
- set(GRPCPP_PP_INCLUDE FALSE)
- else()
- message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}")
- endif()
if(ARROW_USE_ASAN)
# Disable ASAN in system gRPC.
add_library(gRPC::grpc_asan_suppressed INTERFACE IMPORTED)
diff --git a/cpp/src/arrow/flight/flight_test.cc
b/cpp/src/arrow/flight/flight_test.cc
index d56dc81e35..1e7ea9bb00 100644
--- a/cpp/src/arrow/flight/flight_test.cc
+++ b/cpp/src/arrow/flight/flight_test.cc
@@ -46,11 +46,7 @@
#error "gRPC headers should not be in public API"
#endif
-#ifdef GRPCPP_PP_INCLUDE
#include <grpcpp/grpcpp.h>
-#else
-#include <grpc++/grpc++.h>
-#endif
// Include before test_util.h (boost), contains Windows fixes
#include "arrow/flight/platform.h"
diff --git a/cpp/src/arrow/flight/transport/grpc/customize_grpc.h
b/cpp/src/arrow/flight/transport/grpc/customize_grpc.h
index 1085a94696..5005fc6b16 100644
--- a/cpp/src/arrow/flight/transport/grpc/customize_grpc.h
+++ b/cpp/src/arrow/flight/transport/grpc/customize_grpc.h
@@ -31,17 +31,8 @@
#pragma warning(disable : 4267)
#endif
-#ifdef GRPCPP_PP_INCLUDE
#include <grpcpp/impl/codegen/config_protobuf.h>
-#else
-#include <grpc++/impl/codegen/config_protobuf.h>
-#endif
-
-#ifdef GRPCPP_PP_INCLUDE
#include <grpcpp/impl/codegen/proto_utils.h>
-#else
-#include <grpc++/impl/codegen/proto_utils.h>
-#endif
#ifdef _MSC_VER
#pragma warning(pop)
diff --git a/cpp/src/arrow/flight/transport/grpc/grpc_client.cc
b/cpp/src/arrow/flight/transport/grpc/grpc_client.cc
index a1d0e3266b..89f0886383 100644
--- a/cpp/src/arrow/flight/transport/grpc/grpc_client.cc
+++ b/cpp/src/arrow/flight/transport/grpc/grpc_client.cc
@@ -25,15 +25,10 @@
#include <unordered_map>
#include <utility>
-#include "arrow/util/config.h"
-#ifdef GRPCPP_PP_INCLUDE
#include <grpcpp/grpcpp.h>
#if defined(GRPC_NAMESPACE_FOR_TLS_CREDENTIALS_OPTIONS)
#include <grpcpp/security/tls_credentials_options.h>
#endif
-#else
-#include <grpc++/grpc++.h>
-#endif
#include <grpc/grpc_security_constants.h>
diff --git a/cpp/src/arrow/flight/transport/grpc/grpc_server.cc
b/cpp/src/arrow/flight/transport/grpc/grpc_server.cc
index dcf9c3f8c9..2c7a1d5e99 100644
--- a/cpp/src/arrow/flight/transport/grpc/grpc_server.cc
+++ b/cpp/src/arrow/flight/transport/grpc/grpc_server.cc
@@ -25,12 +25,7 @@
#include <unordered_map>
#include <utility>
-#include "arrow/util/config.h"
-#ifdef GRPCPP_PP_INCLUDE
#include <grpcpp/grpcpp.h>
-#else
-#include <grpc++/grpc++.h>
-#endif
#include "arrow/buffer.h"
#include "arrow/flight/serialization_internal.h"
diff --git a/cpp/src/arrow/flight/transport/grpc/serialization_internal.cc
b/cpp/src/arrow/flight/transport/grpc/serialization_internal.cc
index 8514ca361d..cff111d64d 100644
--- a/cpp/src/arrow/flight/transport/grpc/serialization_internal.cc
+++ b/cpp/src/arrow/flight/transport/grpc/serialization_internal.cc
@@ -36,13 +36,8 @@
#include <google/protobuf/wire_format_lite.h>
#include <grpc/byte_buffer_reader.h>
-#ifdef GRPCPP_PP_INCLUDE
#include <grpcpp/grpcpp.h>
#include <grpcpp/impl/codegen/proto_utils.h>
-#else
-#include <grpc++/grpc++.h>
-#include <grpc++/impl/codegen/proto_utils.h>
-#endif
#if defined(_MSC_VER)
#pragma warning(pop)
diff --git a/cpp/src/arrow/flight/transport/grpc/util_internal.cc
b/cpp/src/arrow/flight/transport/grpc/util_internal.cc
index f9bf26058a..f431fc30ec 100644
--- a/cpp/src/arrow/flight/transport/grpc/util_internal.cc
+++ b/cpp/src/arrow/flight/transport/grpc/util_internal.cc
@@ -22,11 +22,7 @@
#include <memory>
#include <string>
-#ifdef GRPCPP_PP_INCLUDE
#include <grpcpp/grpcpp.h>
-#else
-#include <grpc++/grpc++.h>
-#endif
#include "arrow/flight/transport.h"
#include "arrow/flight/types.h"
diff --git a/cpp/src/arrow/util/config.h.cmake
b/cpp/src/arrow/util/config.h.cmake
index f6fad2016a..1008b9c6b9 100644
--- a/cpp/src/arrow/util/config.h.cmake
+++ b/cpp/src/arrow/util/config.h.cmake
@@ -57,5 +57,3 @@
#cmakedefine ARROW_WITH_MUSL
#cmakedefine ARROW_WITH_OPENTELEMETRY
#cmakedefine ARROW_WITH_UCX
-
-#cmakedefine GRPCPP_PP_INCLUDE