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-11 20:22:11 -0700
commit31e5f7120bdd2f76337686d9d169b1c00e6ee69c (patch)
tree74234b6fa2b2dfc89aaf237375faf7b73f5a3a08 /llvm/lib/Support/Compression.cpp
parent1a67522d3ef4b5b1d6d14f47895a6ad11598573c (diff)
downloadllvm-31e5f7120bdd2f76337686d9d169b1c00e6ee69c.zip
llvm-31e5f7120bdd2f76337686d9d169b1c00e6ee69c.tar.gz
llvm-31e5f7120bdd2f76337686d9d169b1c00e6ee69c.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());
}