[llvm] r313763 - Make libcxx tests work when llvm sources are not present.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 20 09:01:50 PDT 2017


Author: zturner
Date: Wed Sep 20 09:01:50 2017
New Revision: 313763

URL: http://llvm.org/viewvc/llvm-project?rev=313763&view=rev
Log:
Make libcxx tests work when llvm sources are not present.

Despite a strong CMake warning that this is an unsupported
libcxx build configuration, some bots still rely on being
able to check out lit and libcxx independently with no
LLVM sources, and then run lit against libcxx.

A previous patch broke that workflow, so this is making it work
again.  Unfortunately, it breaks generation of the llvm-lit
script for libcxx, but we will just have to live with that until
a solution is found that allows libcxx to make more use of
llvm build pieces.  libcxx can still run tests by using the
ninja check target, or by running lit.py directly against the
build tree or source tree.

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

Modified:
    llvm/trunk/cmake/modules/AddLLVM.cmake

Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=313763&r1=313762&r2=313763&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Wed Sep 20 09:01:50 2017
@@ -1198,7 +1198,12 @@ function(get_llvm_lit_path base_dir file
   cmake_parse_arguments(ARG "ALLOW_EXTERNAL" "" "" ${ARGN})
 
   if (ARG_ALLOW_EXTERNAL)
+    set(LLVM_DEFAULT_EXTERNAL_LIT "${LLVM_EXTERNAL_LIT}")
     set (LLVM_EXTERNAL_LIT "" CACHE STRING "Command used to spawn lit")
+    if ("${LLVM_EXTERNAL_LIT}" STREQUAL "")
+      set(LLVM_EXTERNAL_LIT "${LLVM_DEFAULT_EXTERNAL_LIT}")
+    endif()
+
     if (NOT "${LLVM_EXTERNAL_LIT}" STREQUAL "")
       if (EXISTS ${LLVM_EXTERNAL_LIT})
         get_filename_component(LIT_FILE_NAME ${LLVM_EXTERNAL_LIT} NAME)
@@ -1230,9 +1235,7 @@ function(get_llvm_lit_path base_dir file
   elseif(NOT "${LLVM_RUNTIME_OUTPUT_INTDIR}" STREQUAL "")
     set(LLVM_LIT_BASE_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
   else()
-    message(WARNING "Could not find suitable output location for llvm-lit."
-                    "Using default ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit")
-    set(LLVM_LIT_BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
+    set(LLVM_LIT_BASE_DIR "")
   endif()
 
   # Cache this so we don't have to do it again and have subsequent calls




More information about the llvm-commits mailing list