Skip to content

Commit

Permalink
GH-35205: [C++][Gandiva] Don't find system Zstandard when we use bund…
Browse files Browse the repository at this point in the history
…led 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]>
  • Loading branch information
kou authored and raulcd committed Apr 19, 2023
1 parent 6d944a0 commit 00ee100
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cpp/src/gandiva/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
3 changes: 2 additions & 1 deletion cpp/src/gandiva/GandivaConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
@PACKAGE_INIT@

set(ARROW_LLVM_VERSIONS "@ARROW_LLVM_VERSIONS@")
set(ARROW_ZSTD_SOURCE "@zstd_SOURCE@")

include(CMakeFindDependencyMacro)
find_dependency(Arrow)
Expand All @@ -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)
Expand Down

0 comments on commit 00ee100

Please sign in to comment.