kou commented on a change in pull request #7842:
URL: https://github.com/apache/arrow/pull/7842#discussion_r463290240



##########
File path: cpp/cmake_modules/FindSnappy.cmake
##########
@@ -15,25 +15,33 @@
 # specific language governing permissions and limitations
 # under the License.
 
+set(SNAPPY_STATIC_LIB_SUFFIX 
"${SNAPPY_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+
+if(ARROW_SNAPPY_USE_SHARED)
+  set(SNAPPY_LIB_NAMES snappy)
+else()
+  set(SNAPPY_LIB_NAMES 
"${CMAKE_STATIC_LIBRARY_PREFIX}snappy${SNAPPY_STATIC_LIB_SUFFIX}" snappy)
+endif()
+
 if(Snappy_ROOT)
   find_library(Snappy_LIB
-               NAMES snappy
+               NAMES ${SNAPPY_LIB_NAMES}
                PATHS ${Snappy_ROOT}
-               PATH_SUFFIXES ${LIB_PATH_SUFFIXES}
+               PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}
                NO_DEFAULT_PATH)
   find_path(Snappy_INCLUDE_DIR
             NAMES snappy.h
             PATHS ${Snappy_ROOT}
             NO_DEFAULT_PATH
-            PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES})
+            PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES})
 else()
-  find_library(Snappy_LIB NAMES snappy)
-  find_path(Snappy_INCLUDE_DIR NAMES snappy.h PATH_SUFFIXES 
${INCLUDE_PATH_SUFFIXES})
+  find_library(Snappy_LIB NAMES ${SNAPPY_LIB_NAMES} HINTS 
"${CMAKE_ROOT}/Modules/")

Review comment:
       Could you explain why the `HINTS` is needed?
   I don't think that `libsnappy.so` exists in `${CMAKE_ROOT}/Modules/`.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to