]> granicus.if.org Git - clang/commitdiff
[cmake] Use llvm-lit directory when provided for stand-alone build
authorMichal Gorny <mgorny@gentoo.org>
Fri, 17 Nov 2017 22:21:23 +0000 (22:21 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Fri, 17 Nov 2017 22:21:23 +0000 (22:21 +0000)
After the recent lit test changes, clang attempts to run its tests
via llvm-lit by default. However, the llvm-lit binary is not present
when performing stand-alone build resulting in a failure out of the box.

To solve that, add the llvm-lit directory to CMake when performing
a stand-alone build and LLVM sources are provided. This includes
the CMake rules generating the llvm-lit binary and effectively makes
it possible for clang to use it.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318562 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt

index b5a245d0389ff02edf70fd512fbef1db4d91b8c3..a60d11793a50678a97b02d5bff09486b553fec71 100644 (file)
@@ -132,6 +132,9 @@ Please install Python or specify the PYTHON_EXECUTABLE CMake variable.")
     if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
       # Note: path not really used, except for checking if lit was found
       set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
+      if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)
+        add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit utils/llvm-lit)
+      endif()
       if(NOT LLVM_UTILS_PROVIDED)
         add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/FileCheck utils/FileCheck)
         add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/count utils/count)