forked from microsoft/qsharp-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.ps1
49 lines (42 loc) · 1.88 KB
/
bootstrap.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
$ErrorActionPreference = 'Stop'
Push-Location (Join-Path $PSScriptRoot "build")
.\prerequisites.ps1
Pop-Location
cargo install cargo-edit
Push-Location (Join-Path $PSScriptRoot "./src/Simulation/qdk_sim_rs")
cargo set-version $Env:NUGET_VERSION;
Pop-Location
if (-not (Test-Path Env:/AGENT_OS)) { # If not CI build, i.e. local build (if AGENT_OS envvar is not defined)
if ($Env:ENABLE_NATIVE -ne "false") {
$Env:BUILD_CONFIGURATION = "Release"
Write-Host "Build release flavor of the full state simulator"
Push-Location (Join-Path $PSScriptRoot "src/Simulation/Native")
.\build-native-simulator.ps1
Pop-Location
Write-Host "Build release flavor of the Sparse Simulator"
Invoke-Expression (Join-Path $PSScriptRoot "src" "Simulation" "NativeSparseSimulator" "build.ps1")
Push-Location (Join-Path $PSScriptRoot "src/Simulation/qdk_sim_rs")
# Don't run the experimental simulator build if we're local
# and prerequisites are missing.
$IsCI = "$Env:TF_BUILD" -ne "" -or "$Env:CI" -eq "true";
if ((Get-Command cargo -ErrorAction SilentlyContinue) -or $IsCI) {
.\build-qdk-sim-rs.ps1
} else {
Write-Verbose "cargo was not installed, skipping qdk_sim_rs build.";
}
Pop-Location
$Env:BUILD_CONFIGURATION = $null
}
if ($Env:ENABLE_QIRRUNTIME -ne "false") {
Write-Host "Build release flavor of the QIR Runtime"
$Env:BUILD_CONFIGURATION = "Release"
Push-Location (Join-Path $PSScriptRoot "src/Qir/Runtime")
.\build-qir-runtime.ps1
Pop-Location
$Env:BUILD_CONFIGURATION = $null
}
Write-Host "Build simulation solution"
dotnet build Simulation.sln
}