[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>
Wed, 5 Aug 2020 23:07:11 +0000 (16:07 -0700)
commit1adc494bce44f6004994deed61b30d4b71fe1d05
tree714295388f30b5b94b9a7758bed2a2fb78763b80
parent978165bf02776a2b957c795a5c1d94f9f208fc8e
[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
22 files changed:
clang/test/CMakeLists.txt
clang/test/lit.site.cfg.py.in
compiler-rt/test/lit.common.configured.in
lld/test/CMakeLists.txt
lld/test/lit.site.cfg.py.in
lldb/cmake/modules/LLDBStandalone.cmake
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
llvm/cmake/config-ix.cmake
llvm/cmake/modules/LLVMConfig.cmake.in
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
llvm/utils/gn/secondary/clang/test/BUILD.gn
llvm/utils/gn/secondary/compiler-rt/test/BUILD.gn
llvm/utils/gn/secondary/lld/test/BUILD.gn
llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn
llvm/utils/gn/secondary/llvm/test/BUILD.gn