[PATCH] D29340: [lld] [test] Fix zlib cond when building stand-alone, clean up

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 12:20:05 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL294508: [test] Fix zlib cond when building stand-alone, clean up (authored by mgorny).

Changed prior to commit:
  https://reviews.llvm.org/D29340?vs=86467&id=87690#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D29340

Files:
  lld/trunk/test/CMakeLists.txt
  lld/trunk/test/lit.cfg
  lld/trunk/test/lit.site.cfg.in


Index: lld/trunk/test/lit.site.cfg.in
===================================================================
--- lld/trunk/test/lit.site.cfg.in
+++ lld/trunk/test/lit.site.cfg.in
@@ -10,7 +10,7 @@
 config.lld_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
 config.target_triple = "@TARGET_TRIPLE@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
-config.have_zlib = "@HAVE_LIBZ@"
+config.have_zlib = @HAVE_LIBZ@
 
 # 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.
Index: lld/trunk/test/CMakeLists.txt
===================================================================
--- lld/trunk/test/CMakeLists.txt
+++ lld/trunk/test/CMakeLists.txt
@@ -3,13 +3,18 @@
 set(LLVM_BUILD_MODE "%(build_mode)s")
 set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
 set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/%(build_config)s")
-set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
-set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
-if(BUILD_SHARED_LIBS)
-  set(ENABLE_SHARED 1)
-else()
-  set(ENABLE_SHARED 0)
-endif(BUILD_SHARED_LIBS)
+
+if(LLD_BUILT_STANDALONE)
+  # Set HAVE_LIBZ according to recorded LLVM_ENABLE_ZLIB value. This
+  # value is forced to 0 if zlib was not found, so it is fine to use it
+  # instead of HAVE_LIBZ (not recorded).
+  if(LLVM_ENABLE_ZLIB)
+    set(HAVE_LIBZ 1)
+  endif()
+endif()
+
+llvm_canonicalize_cmake_booleans(
+  HAVE_LIBZ)
 
 configure_lit_site_cfg(
   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
Index: lld/trunk/test/lit.cfg
===================================================================
--- lld/trunk/test/lit.cfg
+++ lld/trunk/test/lit.cfg
@@ -202,7 +202,7 @@
     config.available_features.add('shell')
 
 # zlib compression library
-if config.have_zlib == "1":
+if config.have_zlib:
     config.available_features.add("zlib")
 
 # Running on Darwin OS


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29340.87690.patch
Type: text/x-patch
Size: 1923 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170208/54be9f3b/attachment.bin>


More information about the llvm-commits mailing list