This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new ce60f2f26e GH-35205: [C++][Gandiva] Don't find system Zstandard when 
we use bundled one (#35220)
ce60f2f26e is described below

commit ce60f2f26eeb085ee39e83e623e7b330aafb10ce
Author: Sutou Kouhei <[email protected]>
AuthorDate: Wed Apr 19 09:02:57 2023 +0900

    GH-35205: [C++][Gandiva] Don't find system Zstandard when we use bundled 
one (#35220)
    
    ### Rationale for this change
    
    If we use bundled Zstandared, we should not find system Zstandard for 
Gandiva.
    Because it's always failed.
    
    ### What changes are included in this PR?
    
    Add a missing check whether we're using system Zstandard or bundled 
Zstandard.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    Yes.
    * Closes: #35205
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/src/gandiva/CMakeLists.txt         | 2 +-
 cpp/src/gandiva/GandivaConfig.cmake.in | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/cpp/src/gandiva/CMakeLists.txt b/cpp/src/gandiva/CMakeLists.txt
index 36c7ac356b..6a92224e91 100644
--- a/cpp/src/gandiva/CMakeLists.txt
+++ b/cpp/src/gandiva/CMakeLists.txt
@@ -27,7 +27,7 @@ add_dependencies(gandiva-all gandiva gandiva-tests 
gandiva-benchmarks)
 
 find_package(LLVMAlt REQUIRED)
 provide_find_module(LLVMAlt "Gandiva")
-if(ARROW_WITH_ZSTD)
+if(ARROW_WITH_ZSTD AND "${zstd_SOURCE}" STREQUAL "SYSTEM")
   provide_find_module(zstdAlt "Gandiva")
 endif()
 
diff --git a/cpp/src/gandiva/GandivaConfig.cmake.in 
b/cpp/src/gandiva/GandivaConfig.cmake.in
index 36e8fa4bb3..f02e29f25b 100644
--- a/cpp/src/gandiva/GandivaConfig.cmake.in
+++ b/cpp/src/gandiva/GandivaConfig.cmake.in
@@ -27,6 +27,7 @@
 @PACKAGE_INIT@
 
 set(ARROW_LLVM_VERSIONS "@ARROW_LLVM_VERSIONS@")
+set(ARROW_ZSTD_SOURCE "@zstd_SOURCE@")
 
 include(CMakeFindDependencyMacro)
 find_dependency(Arrow)
@@ -36,7 +37,7 @@ else()
   unset(GANDIVA_CMAKE_MODULE_PATH_OLD)
 endif()
 set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}")
-if(ARROW_WITH_ZSTD)
+if(ARROW_WITH_ZSTD AND "${ARROW_ZSTD_SOURCE}" STREQUAL "SYSTEM")
   find_dependency(zstdAlt)
 endif()
 find_dependency(LLVMAlt)

Reply via email to