[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:13 PDT 2025


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

This block was copied from clang/CMakeLists.txt.

>From 96d9fc60629e67d4034594f0facb190fc7b384c8 Mon Sep 17 00:00:00 2001
From: Jeremy Drake <github at jdrake.com>
Date: Mon, 5 May 2025 13:15:33 -0700
Subject: [PATCH] [LLD][CMake] fix testing standalone build without installed
 llvm-lit.

This block was copied from clang/CMakeLists.txt.
---
 lld/CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)

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)



More information about the llvm-commits mailing list