[libcxxabi] r322768 - Fix standalone test-suite run.

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 14:07:10 PST 2018


Author: ericwf
Date: Wed Jan 17 14:07:09 2018
New Revision: 322768

URL: http://llvm.org/viewvc/llvm-project?rev=322768&view=rev
Log:
Fix standalone test-suite run.

This patch updates libc++abi's HandleOutOfTreeLLVM.cmake to match
libc++'s -- and more importantly, to fix a bug where llvm-lit wasn't
found/created when libc++abi was built out-of-tree. This prevented
the test suite from running.

Modified:
    libcxxabi/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
    libcxxabi/trunk/test/CMakeLists.txt

Modified: libcxxabi/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake?rev=322768&r1=322767&r2=322768&view=diff
==============================================================================
--- libcxxabi/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake (original)
+++ libcxxabi/trunk/cmake/Modules/HandleOutOfTreeLLVM.cmake Wed Jan 17 14:07:09 2018
@@ -107,14 +107,22 @@ macro(configure_out_of_tree_llvm)
     set(LLVM_ENABLE_SPHINX OFF)
   endif()
 
-  # Required LIT Configuration ------------------------------------------------
-  # Define the default arguments to use with 'lit', and an option for the user
-  # to override.
-  set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported")
-  if (MSVC OR XCODE)
-    set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
+  # In a standalone build, we don't have llvm to automatically generate the
+  # llvm-lit script for us.  So we need to provide an explicit directory that
+  # the configurator should write the script into.
+  set(LLVM_LIT_OUTPUT_DIR "${libcxxabi_BINARY_DIR}/bin")
+
+  if (LLVM_INCLUDE_TESTS)
+    # Required LIT Configuration ------------------------------------------------
+    # Define the default arguments to use with 'lit', and an option for the user
+    # to override.
+    set(LLVM_EXTERNAL_LIT "${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py")
+    set(LIT_ARGS_DEFAULT "-sv --show-xfail --show-unsupported")
+    if (MSVC OR XCODE)
+      set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
+    endif()
+    set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
   endif()
-  set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
 
   # Required doc configuration
   if (LLVM_ENABLE_SPHINX)

Modified: libcxxabi/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/CMakeLists.txt?rev=322768&r1=322767&r2=322768&view=diff
==============================================================================
--- libcxxabi/trunk/test/CMakeLists.txt (original)
+++ libcxxabi/trunk/test/CMakeLists.txt Wed Jan 17 14:07:09 2018
@@ -24,10 +24,6 @@ set(LIBCXXABI_EXECUTOR "None" CACHE STRI
     "Executor to use when running tests.")
 
 set(AUTO_GEN_COMMENT "## Autogenerated by libcxxabi configuration.\n# Do not edit!")
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
-  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
-  @ONLY)
 
 if (LIBCXXABI_ENABLE_SHARED)
   set(LIBCXXABI_TEST_DEPS cxxabi_shared)
@@ -46,6 +42,11 @@ if (NOT LIBCXXABI_STANDALONE_BUILD)
   endif()
 endif()
 
+
+configure_lit_site_cfg(
+  ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
+  ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
+
 add_lit_testsuite(check-cxxabi "Running libcxxabi tests"
   ${CMAKE_CURRENT_BINARY_DIR}
   DEPENDS ${LIBCXXABI_TEST_DEPS}




More information about the cfe-commits mailing list