[llvm] [runtimes] Allow use of external llvm-lit on standalone builds (PR #144347)
Lucas Duarte Prates via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 16 06:07:57 PDT 2025
https://github.com/pratlucas created https://github.com/llvm/llvm-project/pull/144347
When creating a standalone build of the runtimes sub-project, the
current CMake implementation looks for a lit executable that might
potentially exist in the build tree and unconditionally overrides the
value of `LLVM_EXTERNAL_LIT`. Due to this, any value passed via
`-DLLVM_EXTERNAL_LIT` when configuring the CMake project is ignored.
This change adds the `ALLOW_EXTERNAL` argument to the
`get_llvm_lit_path` call in the runtimes' CMakeLists.txt, allowing any
value previously set to be considered.
>From e8989f0ede26676a76b3a6b6b0e60145014a0951 Mon Sep 17 00:00:00 2001
From: Lucas Prates <lucas.prates at arm.com>
Date: Fri, 13 Jun 2025 11:00:28 +0100
Subject: [PATCH] [runtimes] Allow use of external llvm-lit on standalone
builds
When creating a standalone build of the runtimes sub-project, the
current CMake implementation looks for a lit executable that might
potentially exist in the build tree and unconditionally overrides the
value of `LLVM_EXTERNAL_LIT`. Due to this, any value passed via
`-DLLVM_EXTERNAL_LIT` when configuring the CMake project is ignored.
This change adds the `ALLOW_EXTERNAL` argument to the
`get_llvm_lit_path` call in the runtimes' CMakeLists.txt, allowing any
value previously set to be considered.
---
runtimes/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index 878b2eee38618..e4dd4ebfc678d 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -259,7 +259,7 @@ if(LLVM_INCLUDE_TESTS)
# dir rather than ${LLVM_INSTALL_DIR}/bin/llvm-lit (which may not exist if
# LLVM_BINARY_DIR points at an installed LLVM tree rather than a build tree).
set(LLVM_LIT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/bin)
- get_llvm_lit_path(_base_dir _file_name)
+ get_llvm_lit_path(_base_dir _file_name ALLOW_EXTERNAL)
set(LLVM_EXTERNAL_LIT "${_base_dir}/${_file_name}" CACHE STRING "Command used to spawn lit" FORCE)
# Avoid warning about missing llvm-lit from runtimes CMake files. This is
# fine since we call configure_file() to create llvm-lit at the end of this
More information about the llvm-commits
mailing list