[PATCH] D79219: [CMake] Simplify CMake handling for zlib

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 17:38:37 PDT 2020


phosek created this revision.
phosek added reviewers: smeenai, compnerd.
Herald added subscribers: llvm-commits, lldb-commits, Sanitizers, cfe-commits, hiraditya, mgorny.
Herald added projects: clang, Sanitizers, LLDB, LLVM.

Rather than handling zlib handling manually, use `find_package` from CMake
to find zlib properly. Use this to normalize the `LLVM_ENABLE_ZLIB`,
`HAVE_ZLIB`, `HAVE_ZLIB_H`. Furthermore, require zlib if `LLVM_ENABLE_ZLIB` is
set to `YES`, which requires the distributor to explicitly select whether
zlib is enabled or not. This simplifies the CMake handling and usage in
the rest of the tooling.

This is a reland of rGabb0075 <https://reviews.llvm.org/rGabb00753069554c538f3d850897373d093389945> with all followup changes and fixes that should address
issues that were reported in PR44780.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79219

Files:
  clang/CMakeLists.txt
  clang/test/CMakeLists.txt
  clang/test/lit.site.cfg.py.in
  compiler-rt/test/lit.common.configured.in
  lld/CMakeLists.txt
  lld/test/CMakeLists.txt
  lld/test/lit.site.cfg.py.in
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  llvm/cmake/config-ix.cmake
  llvm/include/llvm/Config/config.h.cmake
  llvm/lib/Support/CMakeLists.txt
  llvm/lib/Support/CRC.cpp
  llvm/lib/Support/Compression.cpp
  llvm/test/CMakeLists.txt
  llvm/test/lit.site.cfg.py.in
  llvm/unittests/Support/CompressionTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79219.261400.patch
Type: text/x-patch
Size: 12987 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200501/b9d2f271/attachment-0001.bin>


More information about the llvm-commits mailing list