Skip to content

Commit 24f4cc6

Browse files
committed
add azure-pipeline for x64, arm64, x86, arm
1 parent a8e1358 commit 24f4cc6

File tree

6 files changed

+150
-10
lines changed

6 files changed

+150
-10
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "vcpkg"]
2+
path = vcpkg
3+
url = https://github.com/microsoft/vcpkg.git
4+
fetchRecurseSubmodules = false

azure-devops/install_msvc_preview.ps1

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
$ErrorActionPreference = "Stop"
2+
3+
Function InstallVS
4+
{
5+
# Microsoft hosted agents do not have the required MSVC 14.23 for building MSVC STL.
6+
# This step installs MSVC 14.23, only on Microsoft hosted agents.
7+
8+
Param(
9+
[String]$WorkLoads,
10+
[String]$Sku,
11+
[String]$VSBootstrapperURL)
12+
$exitCode = -1
13+
try
14+
{
15+
Write-Host "Downloading bootstrapper ..."
16+
[string]$bootstrapperExe = Join-Path ${env:Temp} ([System.IO.Path]::GetRandomFileName() + ".exe")
17+
Invoke-WebRequest -Uri $VSBootstrapperURL -OutFile $bootstrapperExe
18+
19+
$Arguments = ('/c', $bootstrapperExe, $WorkLoads, '--quiet', '--norestart', '--wait', '--nocache' )
20+
21+
Write-Host "Starting Install: $Arguments"
22+
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru
23+
$exitCode = $process.ExitCode
24+
25+
if ($exitCode -eq 0 -or $exitCode -eq 3010)
26+
{
27+
Write-Host -Object 'Installation successful!'
28+
}
29+
else
30+
{
31+
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
32+
}
33+
}
34+
catch
35+
{
36+
Write-Host -Object "Failed to install Visual Studio!"
37+
Write-Host -Object $_.Exception.Message
38+
exit $exitCode
39+
}
40+
41+
exit $exitCode
42+
}
43+
44+
# Invalidate the standard installation of VS on the hosted agent.
45+
Move-Item "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/" "C:/Program Files (x86)/Microsoft Visual Studio/2019/nouse/" -Verbose
46+
47+
$WorkLoads = '--add Microsoft.VisualStudio.Component.UWP.VC.ARM64 ' + `
48+
'--add Microsoft.VisualStudio.Component.VC.CLI.Support ' + `
49+
'--add Microsoft.VisualStudio.Component.VC.Runtimes.ARM.Spectre ' + `
50+
'--add Microsoft.VisualStudio.Component.VC.Runtimes.ARM64.Spectre ' + `
51+
'--add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre ' + `
52+
'--add Microsoft.VisualStudio.Component.VC.TestAdapterForBoostTest ' + `
53+
'--add Microsoft.VisualStudio.Component.VC.TestAdapterForGoogleTest ' + `
54+
'--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ' + `
55+
'--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 ' + `
56+
'--add Microsoft.VisualStudio.Component.VC.Tools.ARM ' + `
57+
'--add Microsoft.VisualStudio.Component.Windows10SDK.18362 '
58+
59+
$ReleaseInPath = 'Preview'
60+
$Sku = 'Enterprise'
61+
$VSBootstrapperURL = 'https://aka.ms/vs/16/pre/vs_buildtools.exe'
62+
63+
$ErrorActionPreference = 'Stop'
64+
65+
# Install VS
66+
$exitCode = InstallVS -WorkLoads $WorkLoads -Sku $Sku -VSBootstrapperURL $VSBootstrapperURL
67+
68+
exit $exitCode

azure-devops/run_build.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
parameters:
2+
targetPlatform: 'x64'
3+
4+
jobs:
5+
- job: vs2019_hosted_${{ parameters.targetPlatform }}
6+
pool:
7+
#name: Hosted Windows 2019 with VS2019
8+
name: STL
9+
10+
variables:
11+
vcpkgLocation: '$(Build.SourcesDirectory)/vcpkg'
12+
vcpkgResponseFile: $(Build.SourcesDirectory)/vcpkg_windows.txt
13+
steps:
14+
- checkout: self
15+
submodules: recursive
16+
- task: BatchScript@1
17+
inputs:
18+
filename: 'azure-devops/enforce-clang-format.cmd'
19+
failOnStandardError: true
20+
displayName: 'Enforce clang-format'
21+
# Install VS 2019 preview on Microsoft Hosted Agents only.
22+
- task: PowerShell@2
23+
displayName: 'Install MSVC preview'
24+
condition: or(contains(variables['Agent.Name'], 'Azure Pipelines'), contains(variables['Agent.Name'], 'Hosted Agent'))
25+
inputs:
26+
targetType: filePath
27+
filePath: $(Build.SourcesDirectory)/azure-devops/install_msvc_preview.ps1
28+
- task: CacheBeta@0
29+
displayName: Cache vcpkg
30+
inputs:
31+
key: $(vcpkgResponseFile) | $(Build.SourcesDirectory)/.git/modules/vcpkg/HEAD
32+
path: '$(vcpkgLocation)'
33+
- task: run-vcpkg@0
34+
displayName: 'Run vcpkg to install boost-build'
35+
inputs:
36+
vcpkgArguments: 'boost-build:x86-windows'
37+
vcpkgDirectory: '$(vcpkgLocation)'
38+
- task: run-vcpkg@0
39+
displayName: 'Run vcpkg'
40+
inputs:
41+
vcpkgArguments: '@$(vcpkgResponseFile)'
42+
vcpkgDirectory: '$(vcpkgLocation)'
43+
vcpkgTriplet: ${{ parameters.targetPlatform }}-windows
44+
- task: run-cmake@0
45+
displayName: 'Run CMake with Ninja'
46+
enabled: true
47+
inputs:
48+
cmakeListsTxtPath: 'CMakeSettings.json'
49+
useVcpkgToolchainFile: true
50+
configurationRegexFilter: '.*${{ parameters.targetPlatform }}.*'
51+
buildDirectory: $(Build.ArtifactStagingDirectory)/${{ parameters.targetPlatform }}

azure-pipelines.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1-
# Copyright (c) Microsoft Corporation.
2-
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3-
pool: 'STL'
4-
5-
steps:
6-
- task: BatchScript@1
7-
inputs:
8-
filename: 'azure-devops/enforce-clang-format.cmd'
9-
failOnStandardError: true
10-
displayName: 'Enforce clang-format'
1+
# Copyright (c) Microsoft Corporation.
2+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
# Build STL targeting x64, arm64, x86, arm.
5+
6+
jobs:
7+
- template: azure-devops/run_build.yml
8+
parameters:
9+
targetPlatform: x64
10+
11+
- template: azure-devops/run_build.yml
12+
parameters:
13+
targetPlatform: arm64
14+
15+
- template: azure-devops/run_build.yml
16+
parameters:
17+
targetPlatform: x86
18+
19+
- template: azure-devops/run_build.yml
20+
parameters:
21+
targetPlatform: arm

vcpkg

Submodule vcpkg added at 8413b90

vcpkg_windows.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
boost-build:x86-windows
2+
boost-math:x64-windows
3+
boost-math:x86-windows
4+
boost-math:arm-windows
5+
boost-math:arm64-windows

0 commit comments

Comments
 (0)