Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 800bc95

Browse files
swernlikuzminrobin
authored andcommitted
Force use of Chocolatey installed clang-11 (#841)
1 parent 8cae79d commit 800bc95

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Qir/Runtime/prerequisites.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
if ($Env:ENABLE_QIRRUNTIME -ne "false") {
77
if (($IsWindows) -or ((Test-Path Env:/AGENT_OS) -and ($Env:AGENT_OS.StartsWith("Win")))) {
88
if (!(Get-Command clang -ErrorAction SilentlyContinue) -or `
9-
!(Get-Command clang-format -ErrorAction SilentlyContinue)) {
10-
choco install llvm --version=11.1.0
11-
Write-Host "##vso[task.setvariable variable=PATH;]$Env:Path;C:\Program Files\LLVM\bin"
9+
!(Get-Command clang-format -ErrorAction SilentlyContinue) -or `
10+
(Test-Path Env:/AGENT_OS)) {
11+
choco install llvm --version=11.1.0 --allow-downgrade
12+
Write-Host "##vso[task.setvariable variable=PATH;]$($env:SystemDrive)\Program Files\LLVM\bin;$Env:PATH"
1213
}
1314
if (!(Get-Command ninja -ErrorAction SilentlyContinue)) {
1415
choco install ninja

src/Qir/qir-utils.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,10 @@ function Build-CMakeProject {
192192
$env:CXX = "clang++.exe"
193193
$env:RC = "clang++.exe"
194194

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

200201
if (Get-Command clang-tidy -ErrorAction SilentlyContinue) {

0 commit comments

Comments
 (0)