Skip to content

Commit a2ca1c2

Browse files
committed
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.
1 parent 8f1caf5 commit a2ca1c2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

llvm/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,13 @@ option(LLVM_ENABLE_LIBPFM "Use libpfm for performance counters if available." ON
347347

348348
option(LLVM_ENABLE_THREADS "Use threads if available." ON)
349349

350-
set(LLVM_ENABLE_ZLIB "ON" CACHE STRING "Use zlib for compression/decompression if available. Can be ON, OFF, or FORCE_ON")
350+
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
351+
set(zlib_DEFAULT "OFF")
352+
else()
353+
set(zlib_DEFAULT "ON")
354+
endif()
355+
356+
set(LLVM_ENABLE_ZLIB "${zlib_DEFAULT}" CACHE STRING "Use zlib for compression/decompression if available. Can be ON, OFF, or FORCE_ON")
351357

352358
set(LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.")
353359

0 commit comments

Comments
 (0)