Skip to content

Commit 1d135dc

Browse files
committed
GH-48416: [Packaging][CI] Use special custom orc_for_bundling when using FetchContent to avoid ar issues with + symbol on path
1 parent 9492e6b commit 1d135dc

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3856,7 +3856,24 @@ function(build_orc)
38563856
add_library(orc::orc INTERFACE IMPORTED)
38573857
target_link_libraries(orc::orc INTERFACE orc)
38583858

3859-
list(APPEND ARROW_BUNDLED_STATIC_LIBS orc)
3859+
# ar -M rejects paths with "c++/" because "+" is a line continuation
3860+
# character in MRI scripts, so we have to create a copy of the static lib
3861+
# that we will bundle later (same issue as libgrpc++.a).
3862+
set(ORC_STATIC_LIBRARY_FOR_AR
3863+
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}orc_for_bundling${CMAKE_STATIC_LIBRARY_SUFFIX}"
3864+
)
3865+
add_custom_command(OUTPUT ${ORC_STATIC_LIBRARY_FOR_AR}
3866+
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:orc>
3867+
${ORC_STATIC_LIBRARY_FOR_AR}
3868+
DEPENDS orc)
3869+
add_library(orc::orc_for_bundling STATIC IMPORTED)
3870+
set_target_properties(orc::orc_for_bundling PROPERTIES IMPORTED_LOCATION
3871+
"${ORC_STATIC_LIBRARY_FOR_AR}")
3872+
set_source_files_properties("${ORC_STATIC_LIBRARY_FOR_AR}" PROPERTIES GENERATED TRUE)
3873+
add_custom_target(orc_copy_lib ALL DEPENDS "${ORC_STATIC_LIBRARY_FOR_AR}")
3874+
add_dependencies(orc::orc_for_bundling orc_copy_lib)
3875+
3876+
list(APPEND ARROW_BUNDLED_STATIC_LIBS orc::orc_for_bundling)
38603877
else()
38613878
set(ORC_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/orc_ep-install")
38623879
set(ORC_HOME "${ORC_PREFIX}")

0 commit comments

Comments
 (0)