aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Compression.cpp
diff options
context:
space:
mode:
authorPetr Hosek <phosek@google.com>2020-04-30 13:07:13 -0700
committerPetr Hosek <phosek@google.com>2020-07-23 23:05:36 -0700
commit10b1b4a231a485f1711d576e6131f6755e008abe (patch)
tree4e35a293e15f201c473c73d1a08e8af899d24406 /llvm/lib/Support/Compression.cpp
parent228f8d896573003cba8f51b8cdaf180f22f46124 (diff)
downloadllvm-10b1b4a231a485f1711d576e6131f6755e008abe.zip
llvm-10b1b4a231a485f1711d576e6131f6755e008abe.tar.gz
llvm-10b1b4a231a485f1711d576e6131f6755e008abe.tar.bz2
[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
Diffstat (limited to 'llvm/lib/Support/Compression.cpp')
-rw-r--r--llvm/lib/Support/Compression.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Compression.cpp b/llvm/lib/Support/Compression.cpp
index 27d92f0..b8c77cf 100644
--- a/llvm/lib/Support/Compression.cpp
+++ b/llvm/lib/Support/Compression.cpp
@@ -17,13 +17,13 @@
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
-#if LLVM_ENABLE_ZLIB == 1 && HAVE_ZLIB_H
+#if LLVM_ENABLE_ZLIB
#include <zlib.h>
#endif
using namespace llvm;
-#if LLVM_ENABLE_ZLIB == 1 && HAVE_LIBZ
+#if LLVM_ENABLE_ZLIB
static Error createError(StringRef Err) {
return make_error<StringError>(Err, inconvertibleErrorCode());
}