kou commented on a change in pull request #7388:
URL: https://github.com/apache/arrow/pull/7388#discussion_r438470424
##########
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:
`CMAKE_FIND_DEBUG_MODE` will help us:
```diff
diff --git a/ci/appveyor-cpp-build.bat b/ci/appveyor-cpp-build.bat
index a2ce07656..246029928 100644
--- a/ci/appveyor-cpp-build.bat
+++ b/ci/appveyor-cpp-build.bat
@@ -45,6 +45,7 @@ if "%JOB%" == "Build_Debug" (
-DARROW_USE_PRECOMPILED_HEADERS=OFF ^
-DARROW_VERBOSE_THIRDPARTY_BUILD=OFF ^
-DCMAKE_BUILD_TYPE="Debug" ^
+ -DCMAKE_FIND_DEBUG_MODE=ON ^
-DCMAKE_UNITY_BUILD=ON ^
.. || exit /B
```
----------------------------------------------------------------
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]