build: disable zlib by default on Windows

zlib usage on Windows has caused issues in the past.  Furthermore, the
GNUWin32 library can be detected and used although the headers are not
available.  Require Windows to explicitly opt in.
This commit is contained in:
Saleem Abdulrasool
2020-01-02 12:55:01 -08:00
parent 8f1caf518f
commit a2ca1c2d56

View File

@@ -347,7 +347,13 @@ 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")
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
set(zlib_DEFAULT "OFF")
else()
set(zlib_DEFAULT "ON")
endif()
set(LLVM_ENABLE_ZLIB "${zlib_DEFAULT}" CACHE STRING "Use zlib for compression/decompression if available. Can be ON, OFF, or FORCE_ON")
set(LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.")