Skip to content

Commit fe2cb61

Browse files
committed
Apply suggestion from review
1 parent 4ed4bbb commit fe2cb61

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,9 +3293,13 @@ function(build_crc32c_once)
32933293
set(CRC32C_BUILD_TESTS OFF)
32943294
set(CRC32C_BUILD_BENCHMARKS OFF)
32953295
set(CRC32C_USE_GLOG OFF)
3296-
set(CRC32C_INSTALL OFF)
3296+
#set(CRC32C_INSTALL OFF)
32973297
fetchcontent_makeavailable(crc32c)
32983298

3299+
if(CMAKE_VERSION VERSION_LESS 3.28)
3300+
set_property(DIRECTORY ${crc32_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL TRUE)
3301+
endif()
3302+
32993303
# Create alias target for consistency (crc32c exports as Crc32c::crc32c when installed)
33003304
if(NOT TARGET Crc32c::crc32c)
33013305
add_library(Crc32c::crc32c ALIAS crc32c)
@@ -3398,25 +3402,25 @@ function(build_google_cloud_cpp_storage)
33983402
# Apply patch to add GOOGLE_CLOUD_CPP_ENABLE_INSTALL option so it does not install
33993403
# unconditionally when embedded via FetchContent. Otherwise, we would have to install
34003404
# dependecies like absl, crc32c, nlohmann_json, etc. which is not desirable.
3401-
set(GOOGLE_CLOUD_CPP_PATCH_COMMAND)
3402-
find_program(PATCH patch)
3403-
if(PATCH)
3404-
set(GOOGLE_CLOUD_CPP_PATCH_COMMAND
3405-
${PATCH} -p1 -i ${CMAKE_CURRENT_LIST_DIR}/google-cloud-cpp-disable-install.patch)
3406-
else()
3407-
find_program(GIT git)
3408-
if(GIT)
3409-
set(GOOGLE_CLOUD_CPP_PATCH_COMMAND
3410-
${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/google-cloud-cpp-disable-install.patch)
3411-
else()
3412-
message(FATAL_ERROR "Building google-cloud-cpp from source requires either 'patch' or 'git' to be available"
3413-
)
3414-
endif()
3415-
endif()
3405+
#set(GOOGLE_CLOUD_CPP_PATCH_COMMAND)
3406+
#find_program(PATCH patch)
3407+
#if(PATCH)
3408+
# set(GOOGLE_CLOUD_CPP_PATCH_COMMAND
3409+
# ${PATCH} -p1 -i ${CMAKE_CURRENT_LIST_DIR}/google-cloud-cpp-disable-install.patch)
3410+
#else()
3411+
# find_program(GIT git)
3412+
# if(GIT)
3413+
# set(GOOGLE_CLOUD_CPP_PATCH_COMMAND
3414+
# ${GIT} apply ${CMAKE_CURRENT_LIST_DIR}/google-cloud-cpp-disable-install.patch)
3415+
# else()
3416+
# message(FATAL_ERROR "Building google-cloud-cpp from source requires either 'patch' or 'git' to be available"
3417+
# )
3418+
# endif()
3419+
#endif()
34163420

34173421
fetchcontent_declare(google_cloud_cpp
34183422
${FC_DECLARE_COMMON_OPTIONS}
3419-
PATCH_COMMAND ${GOOGLE_CLOUD_CPP_PATCH_COMMAND}
3423+
#PATCH_COMMAND ${GOOGLE_CLOUD_CPP_PATCH_COMMAND}
34203424
URL ${google_cloud_cpp_storage_SOURCE_URL}
34213425
URL_HASH "SHA256=${ARROW_GOOGLE_CLOUD_CPP_BUILD_SHA256_CHECKSUM}")
34223426

@@ -3429,13 +3433,17 @@ function(build_google_cloud_cpp_storage)
34293433
set(GOOGLE_CLOUD_CPP_ENABLE_WERROR OFF)
34303434
set(GOOGLE_CLOUD_CPP_WITH_MOCKS OFF)
34313435
# Disable installation when embedded via FetchContent
3432-
set(GOOGLE_CLOUD_CPP_ENABLE_INSTALL OFF)
3436+
# set(GOOGLE_CLOUD_CPP_ENABLE_INSTALL OFF)
34333437
set(BUILD_TESTING OFF)
34343438
# Unity build causes some build errors.
34353439
set(CMAKE_UNITY_BUILD FALSE)
34363440

34373441
fetchcontent_makeavailable(google_cloud_cpp)
34383442

3443+
if(CMAKE_VERSION VERSION_LESS 3.28)
3444+
set_property(DIRECTORY ${google_cloud_cpp_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL TRUE)
3445+
endif()
3446+
34393447
# Remove unused directories to save build directory storage.
34403448
# 141MB -> 79MB
34413449
file(REMOVE_RECURSE "${google_cloud_cpp_SOURCE_DIR}/ci")

0 commit comments

Comments
 (0)