File tree Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Expand file tree Collapse file tree 3 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ option(LLVM_ENABLE_LIBPFM "Use libpfm for performance counters if available." ON
347
347
348
348
option (LLVM_ENABLE_THREADS "Use threads if available." ON )
349
349
350
- option (LLVM_ENABLE_ZLIB "Use zlib for compression/decompression if available." ON )
350
+ set (LLVM_ENABLE_ZLIB "ON" CACHE STRING " Use zlib for compression/decompression if available. Can be ON, OFF, or FORCE_ON" )
351
351
352
352
set (LLVM_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver." )
353
353
Original file line number Diff line number Diff line change @@ -117,10 +117,6 @@ endif()
117
117
# Don't look for these libraries if we're using MSan, since uninstrumented third
118
118
# party code may call MSan interceptors like strlen, leading to false positives.
119
119
if (NOT LLVM_USE_SANITIZER MATCHES "Memory.*" )
120
- if (LLVM_ENABLE_ZLIB )
121
- find_package (ZLIB REQUIRED )
122
- endif ()
123
-
124
120
# Don't look for these libraries on Windows.
125
121
if (NOT PURE_WINDOWS )
126
122
# Skip libedit if using ASan as it contains memory leaks.
@@ -506,7 +502,21 @@ else( LLVM_ENABLE_THREADS )
506
502
endif ()
507
503
508
504
if (LLVM_ENABLE_ZLIB )
509
- find_package (ZLIB REQUIRED )
505
+ if (LLVM_ENABLE_ZLIB STREQUAL FORCE_ON )
506
+ find_package (ZLIB REQUIRED )
507
+ else ()
508
+ find_package (ZLIB )
509
+ endif ()
510
+
511
+ if (ZLIB_FOUND )
512
+ set (LLVM_ENABLE_ZLIB "YES" CACHE STRING
513
+ "Use zlib for compression/decompression if available. Can be ON, OFF, or FORCE_ON"
514
+ FORCE )
515
+ else ()
516
+ set (LLVM_ENABLE_ZLIB "NO" CACHE STRING
517
+ "Use zlib for compression/decompression if available. Can be ON, OFF, or FORCE_ON"
518
+ FORCE )
519
+ endif ()
510
520
endif ()
511
521
512
522
if (LLVM_ENABLE_DOXYGEN )
Original file line number Diff line number Diff line change 1
- set (system_libs ${ZLIB_LIBRARY} )
1
+ if (LLVM_ENABLE_ZLIB )
2
+ set (system_libs ${ZLIB_LIBRARY} )
3
+ endif ()
4
+
2
5
if ( MSVC OR MINGW )
3
6
# libuuid required for FOLDERID_Profile usage in lib/Support/Windows/Path.inc.
4
7
# advapi32 required for CryptAcquireContextW in lib/Support/Windows/Path.inc.
You can’t perform that action at this time.
0 commit comments