From 880d4fcdcd1b0abca3a86c30596cd6e2d55272ef Mon Sep 17 00:00:00 2001 From: James Henderson Date: Thu, 2 Jan 2020 15:34:40 +0000 Subject: [PATCH] Revert "build: make `LLVM_ENABLE_ZLIB` a tri-bool for users" This reverts commit e6c7ed6d2164a0659fd9f6ee44f1375d301e3cad. This commit was an attempt to fix the build bots, but it still left the clang-x64-windows-msvc bot in a broken state. --- CMakeLists.txt | 2 +- cmake/config-ix.cmake | 20 +++++--------------- lib/Support/CMakeLists.txt | 5 +---- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25f60da41a2..3505723751f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -347,7 +347,7 @@ option(LLVM_ENABLE_LIBPFM "Use libpfm for performance counters if available." ON option(LLVM_ENABLE_THREADS "Use threads if available." ON) -set(LLVM_ENABLE_ZLIB "ON" CACHE STRING "Use zlib for compression/decompression if available. Can be ON, OFF, or FORCE_ON") +option(LLVM_ENABLE_ZLIB "Use zlib for compression/decompression if available." ON) set(LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.") diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake index a16038f7098..d5a15a680a6 100644 --- a/cmake/config-ix.cmake +++ b/cmake/config-ix.cmake @@ -117,6 +117,10 @@ endif() # Don't look for these libraries if we're using MSan, since uninstrumented third # party code may call MSan interceptors like strlen, leading to false positives. if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*") + if(LLVM_ENABLE_ZLIB) + find_package(ZLIB REQUIRED) + endif() + # Don't look for these libraries on Windows. if (NOT PURE_WINDOWS) # Skip libedit if using ASan as it contains memory leaks. @@ -502,21 +506,7 @@ else( LLVM_ENABLE_THREADS ) endif() if(LLVM_ENABLE_ZLIB) - if(LLVM_ENABLE_ZLIB STREQUAL FORCE_ON) - find_package(ZLIB REQUIRED) - else() - find_package(ZLIB) - endif() - - if(ZLIB_FOUND) - set(LLVM_ENABLE_ZLIB "YES" CACHE STRING - "Use zlib for compression/decompression if available. Can be ON, OFF, or FORCE_ON" - FORCE) - else() - set(LLVM_ENABLE_ZLIB "NO" CACHE STRING - "Use zlib for compression/decompression if available. Can be ON, OFF, or FORCE_ON" - FORCE) - endif() + find_package(ZLIB REQUIRED) endif() if (LLVM_ENABLE_DOXYGEN) diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt index 26332d4f539..2fa641ff5da 100644 --- a/lib/Support/CMakeLists.txt +++ b/lib/Support/CMakeLists.txt @@ -1,7 +1,4 @@ -if(LLVM_ENABLE_ZLIB) - set(system_libs ${ZLIB_LIBRARY}) -endif() - +set(system_libs ${ZLIB_LIBRARY}) if( MSVC OR MINGW ) # libuuid required for FOLDERID_Profile usage in lib/Support/Windows/Path.inc. # advapi32 required for CryptAcquireContextW in lib/Support/Windows/Path.inc.