Skip to content

Commit 9af482d

Browse files
authored
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 1ff2cbb commit 9af482d

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
@@ -69,6 +69,11 @@ async def _get_brew_llvm_prefix(*, echo: bool = False) -> str | None:
6969

7070
@_async_cache
7171
async def _find_tool(tool: str, *, echo: bool = False) -> str | None:
72+
# Explicitly defined LLVM installation location
73+
if (llvm_root := os.getenv("LLVM_ROOT")) is not None:
74+
path = os.path.join(llvm_root, "bin", tool)
75+
if await _check_tool_version(path, echo=echo):
76+
return path
7277
# Unversioned executables:
7378
path = tool
7479
if await _check_tool_version(path, echo=echo):

0 commit comments

Comments
 (0)