[test] Fix tests to use more portable LLVM_ENABLE_ZLIB

The HAVE_LIBZ variable is not exported by LLVM, and therefore is not
available in stand-alone builds of other tools. Use LLVM_ENABLE_ZLIB
which is the name under which the effective value is exported.

Additional, use llvm_canonicalize_cmake_booleans() to make sure that
a correct (Python-safe) boolean value is passed down to lit.

Differential Revision: https://reviews.llvm.org/D41725

llvm-svn: 322081
This commit is contained in:
Michal Gorny 2018-01-09 14:44:04 +00:00
parent f6e2b4cb4b
commit c5e0b63e56
2 changed files with 5 additions and 1 deletions

View File

@ -11,6 +11,10 @@ else()
set(ENABLE_SHARED 0)
endif(BUILD_SHARED_LIBS)
# the value is not canonicalized within LLVM
llvm_canonicalize_cmake_booleans(
LLVM_ENABLE_ZLIB)
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)

View File

@ -12,7 +12,7 @@ config.target_triple = "@TARGET_TRIPLE@"
config.python_executable = "@PYTHON_EXECUTABLE@"
config.cc = "@LLDB_TEST_C_COMPILER@"
config.cxx = "@LLDB_TEST_CXX_COMPILER@"
config.have_zlib = @HAVE_LIBZ@
config.have_zlib = @LLVM_ENABLE_ZLIB@
# Support substitution of the tools and libs dirs with user parameters. This is
# used when we can't determine the tool dir at configuration time.