[PATCH] D74176: [CMake] Link against ZLIB::ZLIB

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 22:21:38 PST 2020


phosek marked 3 inline comments as done.
phosek added a comment.

In D74176#1862853 <https://reviews.llvm.org/D74176#1862853>, @smeenai wrote:

> What does the `llvm-config --system-libs` output look like with this?




  $ ./bin/llvm-config --system-libs
  -lrt -ldl -lpthread -lm -lz

I've updated the change. It's a question what output should this produce, especially when you use a custom zlib. When `llvm-config` is used on the same machine, using a full path might be arguably more correct, because you might have multiple different zlib versions and you want to report the one that was used to build LLVM. However, when used on a different machine, reporting a full path probably isn't the right solution since that path will likely be invalid on that machine.



================
Comment at: llvm/lib/Support/CMakeLists.txt:198
+  STRING(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" zlib_library ${zlib_library})
+  STRING(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" zlib_library ${zlib_library})
+  set(llvm_system_libs ${llvm_system_libs} "${zlib_library}")
----------------
smeenai wrote:
> Shouldn't NAME_WE get rid of this already?
In theory yes, but I think that using the `_PREFIX` variable is more precise.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74176/new/

https://reviews.llvm.org/D74176





More information about the llvm-commits mailing list