[llvm] r319533 - [cmake] Enable zlib support on windows

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 15:44:56 PST 2017


Pavel Labath <labath at google.com> writes:

> Hmm... it seems find_library prefers dynamic libraries over static
> ones. I used it because it allows specifying multiple names, and zlib
> tends to be called zlib.lib on windows.
>
> The other benefit of find_library is that it allows you to override
> the library name at configure time, so you can force static linking by
> configuring with -DZLIB_LIBRARY_PATH=/path/to/libz.a.
>
> However, if static linking is preferable as a default, we can change
> the find_library line to something like
>
> find_library(ZLIB_LIBRARY_PATH NAMES libz.a libz.so libz.dylib
> zlibstatic.lib zlib.lib)
>
> What do you think?

libz.a is preferable only if LLVM_BUILD_STATIC is used.

Cheers,
Rafael


More information about the llvm-commits mailing list