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-08-08 16:44:08 -0700
commitccbc1485b55ff4acd21bcfafbf7aec4ed0fd818d (patch)
treeb048c60e54250e3078f5427d5e3e09fb2d6ea67a /llvm/lib/Support/Compression.cpp
parentf4aba9d76c61cc4c87b45e4edb57b1968eb7194c (diff)
downloadllvm-ccbc1485b55ff4acd21bcfafbf7aec4ed0fd818d.zip
llvm-ccbc1485b55ff4acd21bcfafbf7aec4ed0fd818d.tar.gz
llvm-ccbc1485b55ff4acd21bcfafbf7aec4ed0fd818d.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());
}