Skip to content

Commit

Permalink
GH-43134: [C++] Upgrade bundled google-cloud-cpp to 2.22.0 (#43136)
Browse files Browse the repository at this point in the history
### Rationale for this change

`google_cloud_cpp_mocks` depends on `GTest::gmock_main` but it's built without `BUILD_TESTING`. google-cloud-cpp finds GoogleTest only with `BUILD_TESTING`.

### What changes are included in this PR?

The recent google-cloud-cpp doesn't build `google_cloud_cpp_mocks` without `BUILD_TESTING`.

Note that we can't use 2.23.0 or later because they can't be built with MinGW-w64. See also:
* mingw-w64/mingw-w64#49
* googleapis/google-cloud-cpp#14436

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* GitHub Issue: #43134

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
kou authored and raulcd committed Jul 5, 2024
1 parent 1baa3b0 commit e05f3d9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions ci/scripts/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ build() {
mkdir -p ${cpp_build_dir}
pushd ${cpp_build_dir}

# We use static cURL in google-cloud-cpp. If we can use cURL's CMake
# package, we don't need to specify CURL_STATICLIB explicitly. But
# we don't have cURL's CMake package. We need to use CXXFLAGS
# instead of ARROW_CXXFLAGS because ARROW_CXXFLAGS aren't passed to
# ExternProjects.
export CXXFLAGS="${CXXFLAGS} -DCURL_STATICLIB"
# The Rtools libutf8proc is a static lib, but Findutf8proc.cmake doesn't
# set the appropriate compiler definition.
export CPPFLAGS="-DUTF8PROC_STATIC"
Expand Down
7 changes: 6 additions & 1 deletion cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4225,7 +4225,8 @@ macro(build_nlohmann_json)
set(NLOHMANN_JSON_INCLUDE_DIR "${NLOHMANN_JSON_PREFIX}/include")
set(NLOHMANN_JSON_CMAKE_ARGS
${EP_COMMON_CMAKE_ARGS} "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
-DJSON_BuildTests=OFF)
# google-cloud-cpp requires JSON_MultipleHeaders=ON
-DJSON_BuildTests=OFF -DJSON_MultipleHeaders=ON)

set(NLOHMANN_JSON_BUILD_BYPRODUCTS ${NLOHMANN_JSON_PREFIX}/include/nlohmann/json.hpp)

Expand Down Expand Up @@ -4294,6 +4295,7 @@ macro(build_google_cloud_cpp_storage)
# We need this to build with OpenSSL 3.0.
# See also: https://github.com/googleapis/google-cloud-cpp/issues/8544
-DGOOGLE_CLOUD_CPP_ENABLE_WERROR=OFF
-DGOOGLE_CLOUD_CPP_WITH_MOCKS=OFF
-DOPENSSL_CRYPTO_LIBRARY=${OPENSSL_CRYPTO_LIBRARY}
-DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR}
-DOPENSSL_SSL_LIBRARY=${OPENSSL_SSL_LIBRARY})
Expand Down Expand Up @@ -4380,6 +4382,9 @@ macro(build_google_cloud_cpp_storage)
nlohmann_json::nlohmann_json
OpenSSL::SSL
OpenSSL::Crypto)
if(WIN32)
target_link_libraries(google-cloud-cpp::rest-internal INTERFACE ws2_32)
endif()

add_library(google-cloud-cpp::storage STATIC IMPORTED)
set_target_properties(google-cloud-cpp::storage
Expand Down
4 changes: 2 additions & 2 deletions cpp/thirdparty/versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ ARROW_GFLAGS_BUILD_VERSION=v2.2.2
ARROW_GFLAGS_BUILD_SHA256_CHECKSUM=34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf
ARROW_GLOG_BUILD_VERSION=v0.5.0
ARROW_GLOG_BUILD_SHA256_CHECKSUM=eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5
ARROW_GOOGLE_CLOUD_CPP_BUILD_VERSION=v2.12.0
ARROW_GOOGLE_CLOUD_CPP_BUILD_SHA256_CHECKSUM=8cda870803925c62de8716a765e03eb9d34249977e5cdb7d0d20367e997a55e2
ARROW_GOOGLE_CLOUD_CPP_BUILD_VERSION=v2.22.0
ARROW_GOOGLE_CLOUD_CPP_BUILD_SHA256_CHECKSUM=0c68782e57959c82e0c81def805c01460a042c1aae0c2feee905acaa2a2dc9bf
ARROW_GRPC_BUILD_VERSION=v1.46.3
ARROW_GRPC_BUILD_SHA256_CHECKSUM=d6cbf22cb5007af71b61c6be316a79397469c58c82a942552a62e708bce60964
ARROW_GTEST_BUILD_VERSION=1.11.0
Expand Down

0 comments on commit e05f3d9

Please sign in to comment.