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 14:47:25 -0700
commit1d09ecf36175f7910ffedd6d497c07b5c74c22fb (patch)
tree73e9157bfeb9ca55c3b3fa0bb2c58b41f3a6daf6 /llvm/lib/Support/Compression.cpp
parentc6f21424288971b976b987eacb094be5038aa328 (diff)
downloadllvm-1d09ecf36175f7910ffedd6d497c07b5c74c22fb.zip
llvm-1d09ecf36175f7910ffedd6d497c07b5c74c22fb.tar.gz
llvm-1d09ecf36175f7910ffedd6d497c07b5c74c22fb.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());
}