-
Notifications
You must be signed in to change notification settings - Fork 349
/
azure-pipelines.yml
234 lines (207 loc) · 7.69 KB
/
azure-pipelines.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
variables:
configuration: Release
platform: x64
stages:
- stage: Build
jobs:
- job: Build
strategy:
matrix:
Windows_vc143:
vmImage: windows-2022
project: vs2022
compiler: vc143
installCommand: ''
id: 'vc143_win_$(platform)_$(configuration)'
BUILD_DIR: vc143
Windows_vc142:
vmImage: windows-2019
project: vs2019
compiler: vc142
installCommand: ''
id: 'vc142_win_$(platform)_$(configuration)'
BUILD_DIR: vc142
Windows_clangcl12:
vmImage: windows-2019
project: ninja
compiler: clangcl
installCommand: 'choco install ninja'
id: 'clangcl12_win_$(platform)_$(configuration)'
BUILD_DIR: clangcl12
Windows_gcc13:
vmImage: windows-2019
project: ninja
compiler: mingw
installCommand: 'choco install ninja'
id: 'gcc13_win_$(platform)_$(configuration)'
CC: gcc
CXX: g++
BUILD_DIR: mingw
Linux_gcc11:
vmImage: ubuntu-20.04
project: ninja
compiler: gcc
installCommand: |
sudo dpkg --add-architecture i386
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-11 ninja-build wine64 wine64-tools libwine-dev winetricks libx11-dev libgl1-mesa-dev
export WINEARCH=win64
winetricks
id: 'gcc11_linux_$(platform)_$(configuration)'
CC: gcc-11
CXX: g++-11
BUILD_DIR: gcc11
Linux_gcc13:
vmImage: ubuntu-22.04
project: ninja
compiler: gcc
installCommand: |
sudo dpkg --add-architecture i386
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-13 ninja-build wine64 wine64-tools libwine-dev winetricks libx11-dev libgl1-mesa-dev
export WINEARCH=win64
winetricks
id: 'gcc13_linux_$(platform)_$(configuration)'
CC: gcc-13
CXX: g++-13
BUILD_DIR: gcc13
Linux_clang14:
vmImage: ubuntu-20.04
project: ninja
compiler: clang
installCommand: |
sudo dpkg --add-architecture i386
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install clang-14 libc++-14-dev libc++abi-14-dev lld-14 ninja-build wine64 wine64-tools libwine-dev winetricks libx11-dev libgl1-mesa-dev
export WINEARCH=win64
winetricks
id: 'clang14_linux_$(platform)_$(configuration)'
CC: clang-14
CXX: clang++-14
BUILD_DIR: clang14
Linux_clang16:
vmImage: ubuntu-22.04
project: ninja
compiler: clang
installCommand: |
sudo dpkg --add-architecture i386
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main"
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install clang-16 libc++-16-dev libc++abi-16-dev lld-16 ninja-build wine64 wine64-tools libwine-dev winetricks libx11-dev libgl1-mesa-dev
export WINEARCH=win64
winetricks
id: 'clang16_linux_$(platform)_$(configuration)'
CC: clang-16
CXX: clang++-16
BUILD_DIR: clang16
macOS_clang13:
vmImage: macOS-11
project: ninja
compiler: clang
installCommand: |
export HOMEBREW_NO_INSTALL_CLEANUP=1
brew install --cask xquartz wine-stable
brew install ninja mingw-w64
id: 'clang13_darwin_$(platform)_$(configuration)'
BUILD_DIR: clang13
MACOSX_DEPLOYMENT_TARGET: 11
pool:
vmImage: $(vmImage)
steps:
- checkout: self
fetchDepth: 1
- bash: eval '$(installCommand)'
displayName: 'Install'
condition: ne(variables.installCommand, '')
- pwsh: |
$mingwPath = "C:\msys64\mingw64\bin"
Write-Host "##vso[task.setvariable variable=PATH;]$mingwPath;${env:PATH}";
displayName: 'Config msys2 PATH'
condition: eq(variables.compiler, 'mingw')
- task: Cache@2
inputs:
key: 'Build | Externals/**/CMakeLists.txt | $(id) | $(project)'
restoreKeys: 'Build | $(id) | $(project)'
path: Build/$(BUILD_DIR)
displayName: Cache Build
- task: Cache@2
inputs:
key: 'Externals | Externals/**/CMakeLists.txt | $(id) | $(project)'
restoreKeys: 'Externals | $(id) | $(project)'
path: Externals
displayName: Cache Externals
- task: Cache@2
inputs:
key: 'KlayGE_media | KlayGE/Core/CMakeLists.txt'
restoreKeys: 'KlayGE_media'
path: KlayGE/media
displayName: Cache KlayGE/media
- task: Cache@2
inputs:
key: 'KlayGE_Samples_media | KlayGE/Samples/**/CMakeLists.txt'
restoreKeys: 'KlayGE_Samples_media'
path: KlayGE/Samples/media
displayName: Cache KlayGE/Samples/media
- task: Cache@2
inputs:
key: 'KlayGE_Tests_media | KlayGE/Tests/CMakeLists.txt'
restoreKeys: 'KlayGE_Tests_media'
path: KlayGE/Tests/media
displayName: Cache KlayGE/Tests/media
- task: Cache@2
inputs:
key: 'KlayGE_Tools_media | KlayGE/Tools/**/CMakeLists.txt'
restoreKeys: 'KlayGE_Tools_media'
path: KlayGE/Tools/media
displayName: Cache KlayGE/Tools/media
- task: Cache@2
inputs:
key: 'KlayGE_Tutorials_media | KlayGE/Tutorials/**/CMakeLists.txt'
restoreKeys: 'KlayGE_Tutorials_media'
path: KlayGE/Tutorials/media
displayName: Cache KlayGE/Tutorials/media
- bash: |
git config --global user.email "dummy@example.com"
git config --global user.name "Dummy Name"
# Reset the repo to restore changes in Externals
git reset --hard
displayName: 'Config git'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
addToPath: true
architecture: 'x64'
- task: PythonScript@0
displayName: 'Build'
inputs:
scriptPath: Build.py
arguments: '$(project) $(compiler) $(platform) $(configuration)'
- task: PythonScript@0
displayName: 'Generate artifacts'
inputs:
scriptPath: Package.py
arguments: '$(Build.ArtifactStagingDirectory) $(project) $(compiler) $(platform) $(configuration)'
condition: succeeded()
- bash: 'echo $BUILD_SOURCEVERSION > $BUILD_ARTIFACTSTAGINGDIRECTORY/GIT-COMMIT.txt'
displayName: 'Add commit info'
condition: succeeded()
- task: PublishPipelineArtifact@1
displayName: 'Publish artifacts'
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: KlayGE_Samples_$(id)
condition: succeeded()
- bash: |
rm -rf Build/$(BUILD_DIR)/DXBC2GLSL
rm -rf Build/$(BUILD_DIR)/glloader
rm -rf Build/$(BUILD_DIR)/KFL
rm -rf Build/$(BUILD_DIR)/kfont
rm -rf Build/$(BUILD_DIR)/KlayGE
displayName: 'Remove build files'