forked from compnerd/swift-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swift-numerics.yml
118 lines (98 loc) · 3.99 KB
/
swift-numerics.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
# swift-numerics
pool:
vmImage: 'windows-latest'
resources:
repositories:
- repository: apple/swift-numerics
type: github
name: apple/swift-numerics
endpoint: GitHub
pr:
paths:
include:
- .ci/swift-numerics.yml
trigger:
branches:
include:
- master
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
developer.directory: $(Pipeline.Workspace)/Library/Developer/Platforms/Windows.platform/Developer/Library
steps:
- script: |
git config --global --add core.autocrlf false
git config --global --add core.symlinks true
displayName: Configure GIT
- checkout: apple/swift-numerics
displayName: checkout apple/swift-numerics
- script: |
git config --global user.name builder
git config --global user.email [email protected]
call :ApplyPatches "%SWIFT_NUMERICS_PR%" .
goto :eof
:ApplyPatches
setlocal
set list=%~1
set repository=%~2
for /F "tokens=1*" %%P in ("%list%") do (
git -C %repository% fetch origin pull/%%P/merge
git -C %repository% merge FETCH_HEAD
if not "%%Q" == "" call :ApplyPatches "%%Q" %repository%
)
displayName: Apply Patches
enabled: false
- 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-nuermics
inputs:
cmakeArgs:
-B $(Build.BinariesDirectory)/swift-numerics
-D BUILD_SHARED_LIBS=YES
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=$(Build.StagingDirectory)/swift-numerics-windows-x64/Library/swift-numerics-development/usr
-D CMAKE_Swift_FLAGS="-sdk $(sdk.directory) -resource-dir $(sdk.directory)/usr/lib/swift -I $(sdk.directory)/usr/lib/swift -L $(sdk.directory)/usr/lib/swift/windows -I $(developer.directory)/XCTest-development/usr/lib/swift/windows/x86_64 -L $(developer.directory)/XCTest-development/usr/lib/swift/windows"
-G Ninja
-S $(Build.SourcesDirectory)
- task: CMake@1
displayName: Build swift-numerics
inputs:
cmakeArgs: --build $(Build.BinariesDirectory)/swift-numerics
- task: CMake@1
displayName: Install swift-numerics
inputs:
cmakeArgs: --build $(Build.BinariesDirectory)/swift-numerics --target install
- publish: $(Build.StagingDirectory)/swift-numerics-windows-x64
artifact: swift-numerics-windows-x64