Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-35018: [CI][Java][C++] Use ARROW_ZSTD_USE_SHARED=OFF for LLVM #35023

Merged
merged 4 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions cpp/cmake_modules/FindLLVMAlt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,21 @@ if(LLVM_FOUND)
add_library(LLVM::LLVM_LIBS INTERFACE IMPORTED)
set_target_properties(LLVM::LLVM_LIBS PROPERTIES INTERFACE_LINK_LIBRARIES
"${LLVM_LIBS}")

if(TARGET LLVMSupport AND NOT ARROW_ZSTD_USE_SHARED)
get_target_property(LLVM_SUPPORT_INTERFACE_LINK_LIBRARIES LLVMSupport
INTERFACE_LINK_LIBRARIES)
list(FIND LLVM_SUPPORT_INTERFACE_LINK_LIBRARIES zstd::libzstd_shared
LLVM_SUPPORT_LIBZSTD_INDEX)
if(NOT LLVM_SUPPORT_LIBZSTD_INDEX EQUAL -1)
list(REMOVE_AT LLVM_SUPPORT_INTERFACE_LINK_LIBRARIES ${LLVM_SUPPORT_LIBZSTD_INDEX})
list(INSERT LLVM_SUPPORT_INTERFACE_LINK_LIBRARIES ${LLVM_SUPPORT_LIBZSTD_INDEX}
zstd::libzstd_static)
endif()
set_target_properties(LLVMSupport
PROPERTIES INTERFACE_LINK_LIBRARIES
"${LLVM_SUPPORT_INTERFACE_LINK_LIBRARIES}")
endif()
endif()

mark_as_advanced(CLANG_EXECUTABLE LLVM_LINK_EXECUTABLE)
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/gandiva/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ add_dependencies(gandiva-all gandiva gandiva-tests gandiva-benchmarks)

find_package(LLVMAlt REQUIRED)
provide_find_module(LLVMAlt "Gandiva")
if(ARROW_WITH_ZSTD)
provide_find_module(zstdAlt "Gandiva")
endif()

add_definitions(-DGANDIVA_LLVM_VERSION=${LLVM_VERSION_MAJOR})

Expand Down
3 changes: 3 additions & 0 deletions cpp/src/gandiva/GandivaConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ else()
unset(GANDIVA_CMAKE_MODULE_PATH_OLD)
endif()
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
if(ARROW_WITH_ZSTD)
find_dependency(zstdAlt)
endif()
find_dependency(LLVMAlt)
if(DEFINED GANDIVA_CMAKE_MODULE_PATH_OLD)
set(CMAKE_MODULE_PATH ${GANDIVA_CMAKE_MODULE_PATH_OLD})
Expand Down