Skip to content

Commit 0d7195d

Browse files
committed
Support custom LLVM installation path
Add support for explicitly defined LLVM installation location. This is necessary as MSVC now comes with its own LLVM installation and activating MSVC via vcvars.bat will put LLVM tools on the `PATH` before the local ones.
1 parent 33b2ca8 commit 0d7195d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Tools/jit/_llvm.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ async def _get_brew_llvm_prefix(llvm_version: str, *, echo: bool = False) -> str
7272

7373
@_async_cache
7474
async def _find_tool(tool: str, llvm_version: str, *, echo: bool = False) -> str | None:
75+
# Explicitly defined LLVM installation location
76+
if (llvm_root := os.getenv("LLVM_ROOT")) is not None:
77+
path = os.path.join(llvm_root, "bin", tool)
78+
if await _check_tool_version(path, llvm_version, echo=echo):
79+
return path
7580
# Unversioned executables:
7681
path = tool
7782
if await _check_tool_version(path, llvm_version, echo=echo):

0 commit comments

Comments
 (0)