[compiler-rt] Use ZLIB_FOUND not LLVM_ENABLE_ZLIB

LLVM_ENABLE_ZLIB is set to On by default and does not imply that ZLIB
was actually found, only being set to FORCE_ON would imply that it was
found before control reached compiler-rt/test/CMakeLists.txt. Instead,
use ZLIB_FOUND which guarantees that zlib is available.

Differential Revision: https://reviews.llvm.org/D151229
This commit is contained in:
Alex Brachet 2023-05-25 18:55:47 +00:00
parent 53333c8d44
commit fe2f0ab37c
3 changed files with 5 additions and 2 deletions

View File

@ -12,6 +12,9 @@ option(COMPILER_RT_TEST_STANDALONE_BUILD_LIBS
pythonize_bool(COMPILER_RT_TEST_STANDALONE_BUILD_LIBS)
pythonize_bool(LLVM_ENABLE_EXPENSIVE_CHECKS)
pythonize_bool(ZLIB_FOUND)
configure_compiler_rt_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.common.configured.in
${CMAKE_CURRENT_BINARY_DIR}/lit.common.configured)

View File

@ -231,7 +231,7 @@ if re.match(r"^x86_64.*-linux", config.target_triple):
config.available_features.add("host-byteorder-" + sys.byteorder + "-endian")
if config.have_zlib == "1":
if config.have_zlib:
config.available_features.add("zlib")
# Use ugly construction to explicitly prohibit "clang", "clang++" etc.

View File

@ -65,7 +65,7 @@ elif config.android:
else:
set_default("target_suffix", "-%s" % config.target_arch)
set_default("have_zlib", "@LLVM_ENABLE_ZLIB@")
set_default("have_zlib", @ZLIB_FOUND_PYBOOL@)
set_default("libcxx_used", "@LLVM_LIBCXX_USED@")
# LLVM tools dir can be passed in lit parameters, so try to