[llvm] a2ca1c2 - build: disable zlib by default on Windows

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 12:56:18 PST 2020


Author: Saleem Abdulrasool
Date: 2020-01-02T12:55:52-08:00
New Revision: a2ca1c2d5668683b9a43cddf89131cc106591ee0

URL: https://github.com/llvm/llvm-project/commit/a2ca1c2d5668683b9a43cddf89131cc106591ee0
DIFF: https://github.com/llvm/llvm-project/commit/a2ca1c2d5668683b9a43cddf89131cc106591ee0.diff

LOG: 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.

Added: 
    

Modified: 
    llvm/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 25f60da41a20..ac6eecf6611f 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -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.")
 


        


More information about the llvm-commits mailing list