Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Qir/Runtime/prerequisites.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
if ($Env:ENABLE_QIRRUNTIME -ne "false") {
if (($IsWindows) -or ((Test-Path Env:/AGENT_OS) -and ($Env:AGENT_OS.StartsWith("Win")))) {
if (!(Get-Command clang -ErrorAction SilentlyContinue) -or `
!(Get-Command clang-format -ErrorAction SilentlyContinue)) {
choco install llvm --version=11.1.0
Write-Host "##vso[task.setvariable variable=PATH;]$Env:Path;C:\Program Files\LLVM\bin"
!(Get-Command clang-format -ErrorAction SilentlyContinue) -or `
(Test-Path Env:/AGENT_OS)) {
choco install llvm --version=11.1.0 --allow-downgrade
Write-Host "##vso[task.setvariable variable=PATH;]$($env:SystemDrive)\Program Files\LLVM\bin;$Env:PATH"
}
if (!(Get-Command ninja -ErrorAction SilentlyContinue)) {
choco install ninja
Expand Down
5 changes: 3 additions & 2 deletions src/Qir/qir-utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,10 @@ function Build-CMakeProject {
$env:CXX = "clang++.exe"
$env:RC = "clang++.exe"

if (!(Get-Command clang -ErrorAction SilentlyContinue) -and (choco find --idonly -l llvm) -contains "llvm") {
if ((!(Get-Command clang -ErrorAction SilentlyContinue) -and (choco find --idonly -l llvm) -contains "llvm") -or `
(Test-Path Env:/AGENT_OS)) {
# LLVM was installed by Chocolatey, so add the install location to the path.
$env:PATH += ";$($env:SystemDrive)\Program Files\LLVM\bin"
$env:PATH = "$($env:SystemDrive)\Program Files\LLVM\bin;$env:Path"
}

if (Get-Command clang-tidy -ErrorAction SilentlyContinue) {
Expand Down