From 6fcdde2a4eb9eaf34511ac3a35075be329fe1fae Mon Sep 17 00:00:00 2001 From: Lucas Duarte Prates Date: Wed, 18 Jun 2025 10:26:46 +0100 Subject: [PATCH] [runtimes] Allow use of external llvm-lit on standalone builds (#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. --- runtimes/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt index 878b2eee3861..e4dd4ebfc678 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