[lld] [LLD][CMake] fix testing standalone build without installed llvm-lit. (PR #138575)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 5 13:17:46 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lld

Author: None (jeremyd2019)

<details>
<summary>Changes</summary>

This block was copied from clang/CMakeLists.txt.

---
Full diff: https://github.com/llvm/llvm-project/pull/138575.diff


1 Files Affected:

- (modified) lld/CMakeLists.txt (+3) 


``````````diff
diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
index 55d7599a447fc..9b202cc5d4899 100644
--- a/lld/CMakeLists.txt
+++ b/lld/CMakeLists.txt
@@ -63,6 +63,9 @@ if(LLD_BUILT_STANDALONE)
     if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
       # Note: path not really used, except for checking if lit was found
       set(LLVM_EXTERNAL_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/not utils/not)

``````````

</details>


https://github.com/llvm/llvm-project/pull/138575


More information about the llvm-commits mailing list