Skip to content

Commit 31e5f71

Browse files
committed
[CMake] Simplify CMake handling for zlib
Rather than handling zlib handling manually, use find_package from CMake to find zlib properly. Use this to normalize the LLVM_ENABLE_ZLIB, HAVE_ZLIB, HAVE_ZLIB_H. Furthermore, require zlib if LLVM_ENABLE_ZLIB is set to YES, which requires the distributor to explicitly select whether zlib is enabled or not. This simplifies the CMake handling and usage in the rest of the tooling. This is a reland of abb0075 with all followup changes and fixes that should address issues that were reported in PR44780. Differential Revision: https://reviews.llvm.org/D79219
1 parent 1a67522 commit 31e5f71

File tree

22 files changed

+79
-92
lines changed

22 files changed

+79
-92
lines changed

clang/test/CMakeLists.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,14 @@ endif ()
99

1010
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
1111

12-
if(CLANG_BUILT_STANDALONE)
13-
# Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This
14-
# value is forced to 0 if zlib was not found, so it is fine to use it
15-
# instead of HAVE_LIBZ (not recorded).
16-
if(LLVM_ENABLE_ZLIB)
17-
set(HAVE_LIBZ 1)
18-
endif()
19-
endif()
20-
2112
llvm_canonicalize_cmake_booleans(
2213
CLANG_BUILD_EXAMPLES
2314
CLANG_ENABLE_ARCMT
2415
CLANG_ENABLE_STATIC_ANALYZER
2516
CLANG_SPAWN_CC1
2617
ENABLE_BACKTRACES
2718
ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER
28-
HAVE_LIBZ
19+
LLVM_ENABLE_ZLIB
2920
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR
3021
LLVM_ENABLE_PLUGINS
3122
LLVM_ENABLE_THREADS)

clang/test/lit.site.cfg.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ config.host_triple = "@LLVM_HOST_TRIPLE@"
1616
config.target_triple = "@TARGET_TRIPLE@"
1717
config.host_cxx = "@CMAKE_CXX_COMPILER@"
1818
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
19-
config.have_zlib = @HAVE_LIBZ@
19+
config.have_zlib = @LLVM_ENABLE_ZLIB@
2020
config.clang_arcmt = @CLANG_ENABLE_ARCMT@
2121
config.clang_default_cxx_stdlib = "@CLANG_DEFAULT_CXX_STDLIB@"
2222
config.clang_staticanalyzer = @CLANG_ENABLE_STATIC_ANALYZER@

compiler-rt/test/lit.common.configured.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ elif config.android:
5757
else:
5858
set_default("target_suffix", "-%s" % config.target_arch)
5959

60-
set_default("have_zlib", "@HAVE_LIBZ@")
60+
set_default("have_zlib", "@LLVM_ENABLE_ZLIB@")
6161
set_default("libcxx_used", "@LLVM_LIBCXX_USED@")
6262

6363
# LLVM tools dir can be passed in lit parameters, so try to

lld/test/CMakeLists.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,8 @@ set(LLVM_BUILD_MODE "%(build_mode)s")
44
set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
55
set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/%(build_config)s")
66

7-
if(LLD_BUILT_STANDALONE)
8-
# Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This
9-
# value is forced to 0 if zlib was not found, so it is fine to use it
10-
# instead of HAVE_LIBZ (not recorded).
11-
if(LLVM_ENABLE_ZLIB)
12-
set(HAVE_LIBZ 1)
13-
endif()
14-
endif()
15-
167
llvm_canonicalize_cmake_booleans(
17-
HAVE_LIBZ
8+
LLVM_ENABLE_ZLIB
189
LLVM_LIBXML2_ENABLED
1910
)
2011

lld/test/lit.site.cfg.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
1414
config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
1515
config.target_triple = "@TARGET_TRIPLE@"
1616
config.python_executable = "@Python3_EXECUTABLE@"
17-
config.have_zlib = @HAVE_LIBZ@
17+
config.have_zlib = @LLVM_ENABLE_ZLIB@
1818
config.sizeof_void_p = @CMAKE_SIZEOF_VOID_P@
1919

2020
# Support substitution of the tools and libs dirs with user parameters. This is

lldb/cmake/modules/LLDBStandalone.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ endif()
7474
# CMake modules to be in that directory as well.
7575
list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
7676

77-
if(LLVM_ENABLE_ZLIB)
78-
find_package(ZLIB)
79-
endif()
80-
8177
include(AddLLVM)
8278
include(TableGen)
8379
include(HandleLLVMOptions)

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#include <compression.h>
5151
#endif
5252

53-
#if defined(HAVE_LIBZ)
53+
#if LLVM_ENABLE_ZLIB
5454
#include <zlib.h>
5555
#endif
5656

@@ -582,7 +582,7 @@ bool GDBRemoteCommunication::DecompressPacket() {
582582
}
583583
#endif
584584

585-
#if defined(HAVE_LIBZ)
585+
#if LLVM_ENABLE_ZLIB
586586
if (decompressed_bytes == 0 && decompressed_bufsize != ULONG_MAX &&
587587
decompressed_buffer != nullptr &&
588588
m_compression_type == CompressionType::ZlibDeflate) {

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ void GDBRemoteCommunicationClient::MaybeEnableCompression(
10531053
}
10541054
#endif
10551055

1056-
#if defined(HAVE_LIBZ)
1056+
#if LLVM_ENABLE_ZLIB
10571057
if (avail_type == CompressionType::None) {
10581058
for (auto compression : supported_compressions) {
10591059
if (compression == "zlib-deflate") {

llvm/cmake/config-ix.cmake

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ include(CheckSymbolExists)
99
include(CheckFunctionExists)
1010
include(CheckStructHasMember)
1111
include(CheckCCompilerFlag)
12+
include(CMakePushCheckState)
1213

1314
include(CheckCompilerVersion)
1415
include(HandleLLVMStdlib)
@@ -56,7 +57,6 @@ check_include_file(sys/types.h HAVE_SYS_TYPES_H)
5657
check_include_file(termios.h HAVE_TERMIOS_H)
5758
check_include_file(unistd.h HAVE_UNISTD_H)
5859
check_include_file(valgrind/valgrind.h HAVE_VALGRIND_VALGRIND_H)
59-
check_include_file(zlib.h HAVE_ZLIB_H)
6060
check_include_file(fenv.h HAVE_FENV_H)
6161
check_symbol_exists(FE_ALL_EXCEPT "fenv.h" HAVE_DECL_FE_ALL_EXCEPT)
6262
check_symbol_exists(FE_INEXACT "fenv.h" HAVE_DECL_FE_INEXACT)
@@ -115,22 +115,30 @@ if(HAVE_LIBPTHREAD)
115115
set(LLVM_PTHREAD_LIB ${CMAKE_THREAD_LIBS_INIT})
116116
endif()
117117

118+
if(LLVM_ENABLE_ZLIB)
119+
if(LLVM_ENABLE_ZLIB STREQUAL FORCE_ON)
120+
find_package(ZLIB REQUIRED)
121+
elseif(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
122+
find_package(ZLIB)
123+
endif()
124+
if(ZLIB_FOUND)
125+
# Check if zlib we found is usable; for example, we may have found a 32-bit
126+
# library on a 64-bit system which would result in a link-time failure.
127+
cmake_push_check_state()
128+
set(CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS})
129+
set(CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARY})
130+
check_symbol_exists(compress2 zlib.h HAVE_ZLIB)
131+
cmake_pop_check_state()
132+
if(LLVM_ENABLE_ZLIB STREQUAL FORCE_ON AND NOT HAVE_ZLIB)
133+
message(FATAL_ERROR "Failed to configure zlib")
134+
endif()
135+
endif()
136+
set(LLVM_ENABLE_ZLIB "${HAVE_ZLIB}")
137+
endif()
138+
118139
# Don't look for these libraries if we're using MSan, since uninstrumented third
119140
# party code may call MSan interceptors like strlen, leading to false positives.
120141
if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
121-
set(HAVE_LIBZ 0)
122-
if(LLVM_ENABLE_ZLIB)
123-
foreach(library z zlib_static zlib)
124-
string(TOUPPER ${library} library_suffix)
125-
check_library_exists(${library} compress2 "" HAVE_LIBZ_${library_suffix})
126-
if(HAVE_LIBZ_${library_suffix})
127-
set(HAVE_LIBZ 1)
128-
set(ZLIB_LIBRARIES "${library}")
129-
break()
130-
endif()
131-
endforeach()
132-
endif()
133-
134142
# Don't look for these libraries on Windows.
135143
if (NOT PURE_WINDOWS)
136144
# Skip libedit if using ASan as it contains memory leaks.
@@ -175,10 +183,6 @@ if (LLVM_ENABLE_LIBXML2 STREQUAL "FORCE_ON" AND NOT LLVM_LIBXML2_ENABLED)
175183
message(FATAL_ERROR "Failed to congifure libxml2")
176184
endif()
177185

178-
if (LLVM_ENABLE_ZLIB STREQUAL "FORCE_ON" AND NOT HAVE_LIBZ)
179-
message(FATAL_ERROR "Failed to configure zlib")
180-
endif()
181-
182186
check_library_exists(xar xar_open "" HAVE_LIBXAR)
183187
if(HAVE_LIBXAR)
184188
set(XAR_LIB xar)
@@ -517,13 +521,6 @@ else( LLVM_ENABLE_THREADS )
517521
message(STATUS "Threads disabled.")
518522
endif()
519523

520-
if (LLVM_ENABLE_ZLIB )
521-
# Check if zlib is available in the system.
522-
if ( NOT HAVE_ZLIB_H OR NOT HAVE_LIBZ )
523-
set(LLVM_ENABLE_ZLIB 0)
524-
endif()
525-
endif()
526-
527524
if (LLVM_ENABLE_DOXYGEN)
528525
message(STATUS "Doxygen enabled.")
529526
find_package(Doxygen REQUIRED)

llvm/cmake/modules/LLVMConfig.cmake.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ set(LLVM_ENABLE_THREADS @LLVM_ENABLE_THREADS@)
5151
set(LLVM_ENABLE_UNWIND_TABLES @LLVM_ENABLE_UNWIND_TABLES@)
5252

5353
set(LLVM_ENABLE_ZLIB @LLVM_ENABLE_ZLIB@)
54+
if(LLVM_ENABLE_ZLIB)
55+
find_package(ZLIB)
56+
endif()
5457

5558
set(LLVM_LIBXML2_ENABLED @LLVM_LIBXML2_ENABLED@)
5659

llvm/include/llvm/Config/config.h.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@
115115
/* Define to 1 if you have the `pthread_setname_np' function. */
116116
#cmakedefine HAVE_PTHREAD_SETNAME_NP ${HAVE_PTHREAD_SETNAME_NP}
117117

118-
/* Define to 1 if you have the `z' library (-lz). */
119-
#cmakedefine HAVE_LIBZ ${HAVE_LIBZ}
120-
121118
/* Define to 1 if you have the <link.h> header file. */
122119
#cmakedefine HAVE_LINK_H ${HAVE_LINK_H}
123120

@@ -226,9 +223,6 @@
226223
/* Define to 1 if you have the <valgrind/valgrind.h> header file. */
227224
#cmakedefine HAVE_VALGRIND_VALGRIND_H ${HAVE_VALGRIND_VALGRIND_H}
228225

229-
/* Define to 1 if you have the <zlib.h> header file. */
230-
#cmakedefine HAVE_ZLIB_H ${HAVE_ZLIB_H}
231-
232226
/* Have host's _alloca */
233227
#cmakedefine HAVE__ALLOCA ${HAVE__ALLOCA}
234228

llvm/lib/Support/CMakeLists.txt

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
set(system_libs)
2-
if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
3-
set(system_libs ${system_libs} ${ZLIB_LIBRARIES})
1+
if(LLVM_ENABLE_ZLIB)
2+
set(imported_libs ZLIB::ZLIB)
43
endif()
4+
55
if( MSVC OR MINGW )
66
# libuuid required for FOLDERID_Profile usage in lib/Support/Windows/Path.inc.
77
# advapi32 required for CryptAcquireContextW in lib/Support/Windows/Path.inc.
@@ -194,10 +194,35 @@ add_llvm_component_library(LLVMSupport
194194
${LLVM_MAIN_INCLUDE_DIR}/llvm/ADT
195195
${LLVM_MAIN_INCLUDE_DIR}/llvm/Support
196196
${Backtrace_INCLUDE_DIRS}
197-
LINK_LIBS ${system_libs} ${delayload_flags} ${Z3_LINK_FILES}
197+
LINK_LIBS ${system_libs} ${imported_libs} ${delayload_flags} ${Z3_LINK_FILES}
198198
)
199199

200-
set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${system_libs}")
200+
set(llvm_system_libs ${system_libs})
201+
202+
if(LLVM_ENABLE_ZLIB)
203+
# CMAKE_BUILD_TYPE is only meaningful to single-configuration generators.
204+
if(CMAKE_BUILD_TYPE)
205+
string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
206+
get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION_${build_type})
207+
endif()
208+
if(NOT zlib_library)
209+
get_property(zlib_library TARGET ZLIB::ZLIB PROPERTY LOCATION)
210+
endif()
211+
get_filename_component(zlib_library ${zlib_library} NAME)
212+
if(CMAKE_STATIC_LIBRARY_PREFIX AND CMAKE_STATIC_LIBRARY_SUFFIX AND
213+
zlib_library MATCHES "^${CMAKE_STATIC_LIBRARY_PREFIX}.*${CMAKE_STATIC_LIBRARY_SUFFIX}$")
214+
STRING(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" zlib_library ${zlib_library})
215+
STRING(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" zlib_library ${zlib_library})
216+
endif()
217+
if(CMAKE_SHARED_LIBRARY_PREFIX AND CMAKE_SHARED_LIBRARY_SUFFIX AND
218+
zlib_library MATCHES "^${CMAKE_SHARED_LIBRARY_PREFIX}.*${CMAKE_SHARED_LIBRARY_SUFFIX}$")
219+
STRING(REGEX REPLACE "^${CMAKE_SHARED_LIBRARY_PREFIX}" "" zlib_library ${zlib_library})
220+
STRING(REGEX REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}$" "" zlib_library ${zlib_library})
221+
endif()
222+
set(llvm_system_libs ${llvm_system_libs} "${zlib_library}")
223+
endif()
224+
225+
set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${llvm_system_libs}")
201226

202227
if(LLVM_WITH_Z3)
203228
target_include_directories(LLVMSupport SYSTEM

llvm/lib/Support/CRC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
using namespace llvm;
2727

28-
#if LLVM_ENABLE_ZLIB == 0 || !HAVE_ZLIB_H
28+
#if !LLVM_ENABLE_ZLIB
2929

3030
static const uint32_t CRCTable[256] = {
3131
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f,

llvm/lib/Support/Compression.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
#include "llvm/Support/Compiler.h"
1818
#include "llvm/Support/Error.h"
1919
#include "llvm/Support/ErrorHandling.h"
20-
#if LLVM_ENABLE_ZLIB == 1 && HAVE_ZLIB_H
20+
#if LLVM_ENABLE_ZLIB
2121
#include <zlib.h>
2222
#endif
2323

2424
using namespace llvm;
2525

26-
#if LLVM_ENABLE_ZLIB == 1 && HAVE_LIBZ
26+
#if LLVM_ENABLE_ZLIB
2727
static Error createError(StringRef Err) {
2828
return make_error<StringError>(Err, inconvertibleErrorCode());
2929
}

llvm/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
llvm_canonicalize_cmake_booleans(
22
BUILD_SHARED_LIBS
33
HAVE_LIBXAR
4-
HAVE_LIBZ
54
HAVE_OCAMLOPT
65
HAVE_OCAML_OUNIT
76
LLVM_ENABLE_DIA_SDK
87
LLVM_ENABLE_FFI
98
LLVM_ENABLE_THREADS
9+
LLVM_ENABLE_ZLIB
1010
LLVM_INCLUDE_GO_TESTS
1111
LLVM_LIBXML2_ENABLED
1212
LLVM_LINK_LLVM_DYLIB

llvm/test/lit.site.cfg.py.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ config.host_cxx = "@HOST_CXX@"
3333
config.host_ldflags = '@HOST_LDFLAGS@'
3434
config.llvm_use_intel_jitevents = @LLVM_USE_INTEL_JITEVENTS@
3535
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
36-
config.have_zlib = @HAVE_LIBZ@
36+
config.have_zlib = @LLVM_ENABLE_ZLIB@
3737
config.have_libxar = @HAVE_LIBXAR@
3838
config.have_dia_sdk = @LLVM_ENABLE_DIA_SDK@
3939
config.enable_ffi = @LLVM_ENABLE_FFI@

llvm/unittests/Support/CompressionTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ using namespace llvm;
2121

2222
namespace {
2323

24-
#if LLVM_ENABLE_ZLIB == 1 && HAVE_LIBZ
24+
#if LLVM_ENABLE_ZLIB
2525

2626
void TestZlibCompression(StringRef Input, int Level) {
2727
SmallString<32> Compressed;

llvm/utils/gn/secondary/clang/test/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ write_lit_config("lit_site_cfg") {
7979
}
8080

8181
if (llvm_enable_zlib) {
82-
extra_values += [ "HAVE_LIBZ=1" ]
82+
extra_values += [ "LLVM_ENABLE_ZLIB=1" ]
8383
} else {
84-
extra_values += [ "HAVE_LIBZ=0" ] # Must be 0.
84+
extra_values += [ "LLVM_ENABLE_ZLIB=0" ] # Must be 0.
8585
}
8686

8787
if (host_cpu == "x64") {

llvm/utils/gn/secondary/compiler-rt/test/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ write_cmake_config("lit_common_configured") {
8686
}
8787

8888
if (llvm_enable_zlib) {
89-
values += [ "HAVE_LIBZ=1" ]
89+
values += [ "LLVM_ENABLE_ZLIB=1" ]
9090
} else {
91-
values += [ "HAVE_LIBZ=0" ]
91+
values += [ "LLVM_ENABLE_ZLIB=0" ]
9292
}
9393
}

llvm/utils/gn/secondary/lld/test/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ write_lit_cfg("lit_site_cfg") {
4949
}
5050

5151
if (llvm_enable_zlib) {
52-
extra_values += [ "HAVE_LIBZ=1" ]
52+
extra_values += [ "LLVM_ENABLE_ZLIB=1" ]
5353
} else {
54-
extra_values += [ "HAVE_LIBZ=0" ] # Must be 0.
54+
extra_values += [ "LLVM_ENABLE_ZLIB=0" ] # Must be 0.
5555
}
5656

5757
if (current_cpu == "x64" || current_cpu == "arm64" ||

llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -295,20 +295,10 @@ write_cmake_config("config") {
295295
values += [ "LLVM_ENABLE_DIA_SDK=" ]
296296
}
297297

298-
# FIXME: Once https://reviews.llvm.org/D79219 is in, remove the two
299-
# redundant HAVE_ variables.
300298
if (llvm_enable_zlib) {
301-
values += [
302-
"HAVE_LIBZ=1",
303-
"HAVE_ZLIB_H=1",
304-
"LLVM_ENABLE_ZLIB=1",
305-
]
299+
values += [ "LLVM_ENABLE_ZLIB=1" ]
306300
} else {
307-
values += [
308-
"HAVE_LIBZ=",
309-
"HAVE_ZLIB_H=",
310-
"LLVM_ENABLE_ZLIB=",
311-
]
301+
values += [ "LLVM_ENABLE_ZLIB=" ]
312302
}
313303

314304
if (llvm_enable_libxml2) {

llvm/utils/gn/secondary/llvm/test/BUILD.gn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ write_lit_config("lit_site_cfg") {
174174
}
175175

176176
if (llvm_enable_zlib) {
177-
extra_values += [ "HAVE_LIBZ=1" ]
177+
extra_values += [ "LLVM_ENABLE_ZLIB=1" ]
178178
} else {
179-
extra_values += [ "HAVE_LIBZ=0" ] # Must be 0.
179+
extra_values += [ "LLVM_ENABLE_ZLIB=0" ] # Must be 0.
180180
}
181181
}
182182

0 commit comments

Comments
 (0)