[CMake] Simplify CMake handling for zlib
authorPetr Hosek <phosek@google.com>
Thu, 30 Apr 2020 20:07:13 +0000 (13:07 -0700)
committerPetr Hosek <phosek@google.com>
Fri, 24 Jul 2020 06:05:36 +0000 (23:05 -0700)
commit10b1b4a231a485f1711d576e6131f6755e008abe
tree4e35a293e15f201c473c73d1a08e8af899d24406
parent228f8d896573003cba8f51b8cdaf180f22f46124
[CMake] Simplify CMake handling for zlib

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 abb0075 with all followup changes and fixes that
should address issues that were reported in PR44780.

Differential Revision: https://reviews.llvm.org/D79219
18 files changed:
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
mlir/examples/standalone/CMakeLists.txt