diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-04-23 08:57:30 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-04-23 08:57:30 +0000 |
commit | 28acf056e1e94a70b60b9392a88dc967eaf28e07 (patch) | |
tree | f51900a76ab9813363cf1757b7cdcc7dc7cc3c11 | |
parent | 2fb337e77a9a766cac4d49147592bf9715ff913b (diff) | |
download | bcm5719-llvm-28acf056e1e94a70b60b9392a88dc967eaf28e07.tar.gz bcm5719-llvm-28acf056e1e94a70b60b9392a88dc967eaf28e07.zip |
Add more guards around zlib-dependent code
llvm-svn: 180084
-rw-r--r-- | llvm/include/llvm/Config/config.h.cmake | 3 | ||||
-rw-r--r-- | llvm/lib/Support/Compression.cpp | 2 | ||||
-rw-r--r-- | llvm/unittests/Support/CompressionTest.cpp | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake index 408c590bebb..97af6955d9e 100644 --- a/llvm/include/llvm/Config/config.h.cmake +++ b/llvm/include/llvm/Config/config.h.cmake @@ -230,6 +230,9 @@ /* Define to 1 if you have the `udis86' library (-ludis86). */ #undef HAVE_LIBUDIS86 +/* Define to 1 if you have the 'z' library (-lz). */ +#cmakedefine HAVE_LIBZ ${HAVE_LIBZ} + /* Define to 1 if you have the <limits.h> header file. */ #cmakedefine HAVE_LIMITS_H ${HAVE_LIMITS_H} diff --git a/llvm/lib/Support/Compression.cpp b/llvm/lib/Support/Compression.cpp index d0adf79ec78..497b17ec92b 100644 --- a/llvm/lib/Support/Compression.cpp +++ b/llvm/lib/Support/Compression.cpp @@ -23,7 +23,7 @@ using namespace llvm; -#if LLVM_ENABLE_ZLIB == 1 +#if LLVM_ENABLE_ZLIB == 1 && HAVE_LIBZ static int encodeZlibCompressionLevel(zlib::CompressionLevel Level) { switch (Level) { case zlib::NoCompression: return 0; diff --git a/llvm/unittests/Support/CompressionTest.cpp b/llvm/unittests/Support/CompressionTest.cpp index aad7ed0e89a..c8e2cd9f02b 100644 --- a/llvm/unittests/Support/CompressionTest.cpp +++ b/llvm/unittests/Support/CompressionTest.cpp @@ -22,7 +22,7 @@ using namespace llvm; namespace { -#if LLVM_ENABLE_ZLIB == 1 +#if LLVM_ENABLE_ZLIB == 1 && HAVE_LIBZ void TestZlibCompression(StringRef Input, zlib::CompressionLevel Level) { OwningPtr<MemoryBuffer> Compressed; |