veprbl commented on a change in pull request #7388:
URL: https://github.com/apache/arrow/pull/7388#discussion_r438157379



##########
File path: cpp/cmake_modules/ThirdpartyToolchain.cmake
##########
@@ -1879,13 +1879,26 @@ macro(build_zstd)
 
   add_dependencies(toolchain zstd_ep)
   add_dependencies(ZSTD::zstd zstd_ep)
+  set(ZSTD_LIBRARIES ZSTD::zstd)
 endmacro()
 
 if(ARROW_WITH_ZSTD)
   resolve_dependency(ZSTD)
 
+  # "SYSTEM" source will prioritize cmake config, which exports
+  # zstd::libzstd_{static,shared}
+  if(ARROW_ZSTD_USE_SHARED)
+    if(TARGET zstd::libzstd_shared)
+      set(ZSTD_LIBRARIES zstd::libzstd_shared)
+    endif()
+  else()
+    if(TARGET zstd::libzstd_static)
+      set(ZSTD_LIBRARIES zstd::libzstd_static)
+    endif()
+  endif()
+
   # TODO: Don't use global includes but rather target_include_directories
-  get_target_property(ZSTD_INCLUDE_DIR ZSTD::zstd 
INTERFACE_INCLUDE_DIRECTORIES)
+  get_target_property(ZSTD_INCLUDE_DIR ${ZSTD_LIBRARIES} 
INTERFACE_INCLUDE_DIRECTORIES)

Review comment:
       These are not specific to zstd, so I didn't look into this.




----------------------------------------------------------------
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]


Reply via email to