kou commented on a change in pull request #7388:
URL: https://github.com/apache/arrow/pull/7388#discussion_r438438723
##########
File path: cpp/cmake_modules/FindZSTD.cmake
##########
@@ -21,13 +21,17 @@ endif()
set(ZSTD_STATIC_LIB_SUFFIX
"${ZSTD_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(ZSTD_STATIC_LIB_NAME
${CMAKE_STATIC_LIBRARY_PREFIX}zstd${ZSTD_STATIC_LIB_SUFFIX})
+if(ARROW_ZSTD_USE_SHARED)
+ set(ZSTD_LIB_NAMES
"${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}")
+else()
+ set(ZSTD_LIB_NAMES "${ZSTD_STATIC_LIB_NAME}" "lib${ZSTD_STATIC_LIB_NAME}")
+endif()
# First, find via if specified ZTD_ROOT
if(ZSTD_ROOT)
message(STATUS "Using ZSTD_ROOT: ${ZSTD_ROOT}")
find_library(ZSTD_LIB
- NAMES zstd "${ZSTD_STATIC_LIB_NAME}"
"lib${ZSTD_STATIC_LIB_NAME}"
-
"${CMAKE_SHARED_LIBRARY_PREFIX}zstd${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ NAMES ${ZSTD_LIB_NAMES}
Review comment:
Conda on Windows failed:
https://ci.appveyor.com/project/ApacheSoftwareFoundation/arrow/builds/33446250/job/5pyasx9g6mscq7hm
```text
-- Using ZSTD_ROOT: C:\Miniconda37-x64\envs\arrow/Library
CMake Error at
C:/Miniconda37-x64/envs/arrow/Library/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164
(message):
Could NOT find ZSTD (missing: ZSTD_LIB)
Call Stack (most recent call first):
C:/Miniconda37-x64/envs/arrow/Library/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445
(_FPHSA_FAILURE_MESSAGE)
cmake_modules/FindZSTD.cmake:62 (find_package_handle_standard_args)
cmake_modules/ThirdpartyToolchain.cmake:156 (find_package)
cmake_modules/ThirdpartyToolchain.cmake:1887 (resolve_dependency)
CMakeLists.txt:463 (include)
```
Files in win-64/zstd-1.4.4-h9f78265_3.tar.bz2 at
https://anaconda.org/conda-forge/zstd/files :
```text
zstd-1.4.4-h9f78265_3
|-- Library
| |-- bin
| | |-- libzstd.dll
| | |-- zstd.dll
| | `-- zstd.exe
| |-- include
| | |-- cover.h
| | |-- zbuff.h
| | |-- zdict.h
| | |-- zstd.h
| | `-- zstd_errors.h
| `-- lib
| |-- libzstd.lib
| |-- libzstd_static.lib
| |-- zstd.lib
| `-- zstd_static.lib
`-- info
|-- about.json
|-- files
|-- git
|-- hash_input.json
|-- index.json
|-- licenses
| `-- LICENSE
|-- paths.json
|-- recipe
| |-- bld.bat
| |-- build.sh
| |-- conda_build_config.yaml
| |-- meta.yaml
| `-- meta.yaml.template
|-- run_exports.json
`-- test
`-- run_test.bat
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]