Skip to content

Commit d9031e0

Browse files
committed
Use FC_DECLARE_COMMON_OPTIONS and set EXCLUDE_FROM_ALL to grpc_SOURCE_DIR if CMake less than 3.28
1 parent cac8c3b commit d9031e0

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3196,6 +3196,7 @@ function(build_grpc)
31963196
PARENT_SCOPE)
31973197

31983198
fetchcontent_declare(grpc
3199+
${FC_DECLARE_COMMON_OPTIONS}
31993200
URL ${GRPC_SOURCE_URL}
32003201
URL_HASH "SHA256=${ARROW_GRPC_BUILD_SHA256_CHECKSUM}")
32013202

@@ -3245,16 +3246,11 @@ function(build_grpc)
32453246
" -Wno-attributes -Wno-format-security -Wno-unknown-warning-option")
32463247
endif()
32473248

3248-
# Disable install rules for gRPC so it is not installed on our Linux-packages.
3249-
set(CMAKE_SKIP_INSTALL_RULES ON)
3250-
32513249
fetchcontent_makeavailable(grpc)
32523250

3253-
# CMAKE_SKIP_INSTALL_RULES prevents cmake_install.cmake from being created,
3254-
# but the parent cmake_install.cmake still tries to include() it.
3255-
# Create an empty one manually so include() doesn't fail.
3256-
file(WRITE "${grpc_BINARY_DIR}/cmake_install.cmake"
3257-
"# gRPC install disabled via CMAKE_SKIP_INSTALL_RULES\n")
3251+
if(CMAKE_VERSION VERSION_LESS 3.28)
3252+
set_property(DIRECTORY ${grpc_SOURCE_DIR} PROPERTY EXCLUDE_FROM_ALL TRUE)
3253+
endif()
32583254

32593255
# FetchContent builds gRPC libraries without gRPC:: prefix.
32603256
# Create gRPC:: alias targets for consistency.

0 commit comments

Comments
 (0)