Copilot commented on code in PR #50303:
URL: https://github.com/apache/arrow/pull/50303#discussion_r3497778359
##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -2822,28 +2822,31 @@ if(ARROW_WITH_RAPIDJSON)
FALSE)
endif()
-macro(build_xsimd)
+function(build_xsimd)
+ list(APPEND CMAKE_MESSAGE_INDENT "xsimd: ")
message(STATUS "Building xsimd from source")
- set(XSIMD_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/xsimd_ep/src/xsimd_ep-install")
- set(XSIMD_CMAKE_ARGS ${EP_COMMON_CMAKE_ARGS}
"-DCMAKE_INSTALL_PREFIX=${XSIMD_PREFIX}")
- externalproject_add(xsimd_ep
- ${EP_COMMON_OPTIONS}
- PREFIX "${CMAKE_BINARY_DIR}"
- URL ${XSIMD_SOURCE_URL}
- URL_HASH "SHA256=${ARROW_XSIMD_BUILD_SHA256_CHECKSUM}"
- CMAKE_ARGS ${XSIMD_CMAKE_ARGS})
-
- set(XSIMD_INCLUDE_DIR "${XSIMD_PREFIX}/include")
- # The include directory must exist before it is referenced by a target.
- file(MAKE_DIRECTORY "${XSIMD_INCLUDE_DIR}")
+ fetchcontent_declare(xsimd
+ ${FC_DECLARE_COMMON_OPTIONS} OVERRIDE_FIND_PACKAGE
+ URL ${XSIMD_SOURCE_URL}
+ URL_HASH "SHA256=${ARROW_XSIMD_BUILD_SHA256_CHECKSUM}")
+ fetchcontent_makeavailable(xsimd)
Review Comment:
`build_xsimd()` is the only FetchContent-based vendored dependency here that
doesn’t call `prepare_fetchcontent()`. That means the standard dependency build
settings/policy workarounds (e.g., `CMAKE_POLICY_VERSION_MINIMUM` for CMake 4,
`BUILD_TESTING=OFF`, disabling warnings-as-errors, etc.) won’t be applied while
configuring xsimd, which can lead to inconsistent behavior or configure
failures compared to other vendored deps.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]