forked from compnerd/swift-win32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
89 lines (74 loc) · 3.04 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
# azure-pipelines.yml
trigger:
- main
pr:
- main
pool:
vmImage: 'windows-latest'
variables:
toolchain.directory: $(Pipeline.Workspace)/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain
sdk.directory: $(Pipeline.Workspace)/Library/Developer/Platforms/Windows.platform/Developer/SDKs/Windows.sdk
steps:
- script: |
git config --global --add core.autocrlf false
git config --global --add core.symlinks true
displayName: Configure GIT
- checkout: self
displayName: checkout compnerd/swift-win32
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'specific'
project: '3133d6ab-80a8-4996-ac4f-03df25cd3224'
definition: '7'
buildVersionToDownload: 'latest'
allowPartiallySucceededBuilds: true
artifactName: 'toolchain-windows-x64'
targetPath: '$(Pipeline.Workspace)'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'specific'
project: '3133d6ab-80a8-4996-ac4f-03df25cd3224'
definition: '7'
buildVersionToDownload: 'latest'
allowPartiallySucceededBuilds: true
artifactName: 'sdk-windows-x64'
targetPath: '$(Pipeline.Workspace)'
- task: BatchScript@1
displayName: VsDevCmd
inputs:
filename: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/Tools/VsDevCmd.bat
arguments: -no_logo -arch=x64 -host_arch=x64
modifyEnvironment: true
- script: |
curl -L "https://raw.githubusercontent.com/apple/swift/main/stdlib/public/Platform/ucrt.modulemap" -o "%UniversalCRTSdkDir%\Include\%UCRTVersion%\ucrt\module.modulemap"
curl -L "https://raw.githubusercontent.com/apple/swift/main/stdlib/public/Platform/visualc.modulemap" -o "%VCToolsInstallDir%\include\module.modulemap"
curl -L "https://raw.githubusercontent.com/apple/swift/main/stdlib/public/Platform/visualc.apinotes" -o "%VCToolsInstallDir%\include\visualc.apinotes"
curl -L "https://raw.githubusercontent.com/apple/swift/main/stdlib/public/Platform/winsdk.modulemap" -o "%UniversalCRTSdkDir%\Include\%UCRTVersion%\um\module.modulemap"
displayName: Configure SDK
- script: |
echo ##vso[task.prependpath]$(toolchain.directory)/usr/bin
displayName: Update PATH
- task: CMake@1
displayName: Configure Swift/Win32
inputs:
cmakeArgs:
-B $(Build.BinariesDirectory)/swift-win32
-D BUILD_SHARED_LIBS=YES
-D BUILD_TESTING=NO
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_C_COMPILER=cl
-D CMAKE_CXX_COMPILER=cl
-D CMAKE_INSTALL_PREFIX=$(Build.StagingDirectory)/swift-win32-windows-x64/Library/swift-win32-development/usr
-D CMAKE_Swift_FLAGS="-sdk $(sdk.directory) -resource-dir $(sdk.directory)/usr/lib/swift -L$(sdk.directory)/usr/lib/swift/windows"
-G Ninja
-S $(Build.SourcesDirectory)
- task: CMake@1
displayName: Build Swift/Win32
inputs:
cmakeArgs: --build $(Build.BinariesDirectory)/swift-win32
- task: CMake@1
displayName: Install Swift/Win32
inputs:
cmakeArgs: --build $(Build.BinariesDirectory)/swift-win32 --target install
- publish: $(Build.StagingDirectory)/swift-win32-windows-x64
artifact: swift-win32-windows-x64