From e38a984474650e7fca38b2b68508a85ae1dcd25e Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Tue, 17 Oct 2017 20:51:25 +0000 Subject: [PATCH] Revert "[cmake] Use find_package to discover zlib" We are investigating what went wrong. llvm-svn: 316029 --- llvm/cmake/config-ix.cmake | 5 +---- llvm/lib/Support/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index c90f2d836c8f..7f33591de0c8 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -132,10 +132,7 @@ endif() # like strlen, leading to false positives. if( NOT PURE_WINDOWS AND NOT LLVM_USE_SANITIZER MATCHES "Memory.*") if (LLVM_ENABLE_ZLIB) - find_package(ZLIB REQUIRED) - if (ZLIB_FOUND) - set(HAVE_LIBZ 1) - endif() + check_library_exists(z compress2 "" HAVE_LIBZ) else() set(HAVE_LIBZ 0) endif() diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt index 5dcb5e58af4c..56aaf10ec2cd 100644 --- a/llvm/lib/Support/CMakeLists.txt +++ b/llvm/lib/Support/CMakeLists.txt @@ -22,7 +22,7 @@ elseif( CMAKE_HOST_UNIX ) endif() set(system_libs ${system_libs} ${LLVM_PTHREAD_LIB}) if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ ) - set(system_libs ${system_libs} ${ZLIB_LIBRARIES}) + set(system_libs ${system_libs} z) endif() if( UNIX AND NOT (BEOS OR HAIKU) ) set(system_libs ${system_libs} m)