-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathcmake-configure-build.yml
72 lines (70 loc) · 2.74 KB
/
cmake-configure-build.yml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
parameters:
- name: hostArch
type: string
- name: targetArch
type: string
- name: analyzeBuild
type: boolean
- name: asanBuild
type: boolean
- name: buildBenchmarks
type: boolean
- name: testsBuildOnly
type: boolean
- name: litFlags
type: object
default:
- '--xunit-xml-output=$(buildOutputLocation)/test-results.xml'
- '--order=lexical'
- '--num-shards=$(System.TotalJobsInPhase)'
- '--run-shard=$(System.JobPositionInPhase)'
steps:
- script: |
if exist "$(buildOutputLocation)" (
rmdir /S /Q "$(buildOutputLocation)"
)
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
-host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo
cmake -G Ninja ^
-DCMAKE_CXX_COMPILER=cl ^
-DCMAKE_BUILD_TYPE=Release ^
-DLIT_FLAGS=${{ join(';', parameters.litFlags) }} ^
-DSTL_USE_ANALYZE=${{ parameters.analyzeBuild }} ^
-DSTL_ASAN_BUILD=${{ parameters.asanBuild }} ^
-DTESTS_BUILD_ONLY=${{ parameters.testsBuildOnly }} ^
-S $(Build.SourcesDirectory) -B "$(buildOutputLocation)"
displayName: 'Configure the STL'
timeoutInMinutes: 2
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
- script: |
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
-host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo
cmake --build "$(buildOutputLocation)"
displayName: 'Build the STL'
timeoutInMinutes: 5
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
- script: |
if exist "$(benchmarkBuildOutputLocation)" (
rmdir /S /Q "$(benchmarkBuildOutputLocation)"
)
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
-host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo
cmake -G Ninja ^
-DCMAKE_CXX_COMPILER=cl ^
-DCMAKE_BUILD_TYPE=Release ^
-DSTL_BINARY_DIR="$(buildOutputLocation)" ^
-S $(Build.SourcesDirectory)/benchmarks -B "$(benchmarkBuildOutputLocation)"
displayName: 'Configure the benchmarks'
timeoutInMinutes: 2
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
condition: and(succeeded(), ${{ parameters.buildBenchmarks }})
- script: |
call "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\Common7\Tools\VsDevCmd.bat" ^
-host_arch=${{ parameters.hostArch }} -arch=${{ parameters.targetArch }} -no_logo
cmake --build "$(benchmarkBuildOutputLocation)"
displayName: 'Build the benchmarks'
timeoutInMinutes: 2
env: { TMP: $(tmpDir), TEMP: $(tmpDir) }
condition: and(succeeded(), ${{ parameters.buildBenchmarks }})