[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.
This commit is contained in:
Lucas Duarte Prates
2025-06-18 10:26:46 +01:00
committed by GitHub
parent 58c4fa96cb
commit 6fcdde2a4e

View File

@@ -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