6
6
. PARAMETER debug
7
7
If set, build the "Debug" configuration of libgit2, rather than "Release" (default).
8
8
. PARAMETER x86
9
- If set, the 32-bit version will be built.
9
+ If set, the x86 version will be built.
10
10
. PARAMETER x64
11
- If set, the 64-bit version will be built.
11
+ If set, the x64 version will be built.
12
+ . PARAMETER arm64
13
+ If set, the arm64 version will be built.
12
14
#>
13
15
14
16
Param (
15
17
[switch ]$test ,
16
18
[switch ]$debug ,
17
19
[switch ]$x86 ,
18
- [switch ]$x64
20
+ [switch ]$x64 ,
21
+ [switch ]$arm64
19
22
)
20
23
21
24
Set-StrictMode - Version Latest
@@ -24,6 +27,7 @@ $projectDirectory = Split-Path $MyInvocation.MyCommand.Path
24
27
$libgit2Directory = Join-Path $projectDirectory " libgit2"
25
28
$x86Directory = Join-Path $projectDirectory " nuget.package\runtimes\win-x86\native"
26
29
$x64Directory = Join-Path $projectDirectory " nuget.package\runtimes\win-x64\native"
30
+ $arm64Directory = Join-Path $projectDirectory " nuget.package\runtimes\win-arm64\native"
27
31
$hashFile = Join-Path $projectDirectory " nuget.package\libgit2\libgit2_hash.txt"
28
32
$sha = Get-Content $hashFile
29
33
$binaryFilename = " git2-" + $sha.Substring (0 , 7 )
@@ -108,7 +112,7 @@ try {
108
112
cd build
109
113
110
114
if ($x86.IsPresent ) {
111
- Write-Output " Building 32-bit ..."
115
+ Write-Output " Building x86 ..."
112
116
Run- Command - Fatal { & $cmake - G " Visual Studio 16 2019" - A Win32 - D ENABLE_TRACE= ON - D USE_SSH= OFF - D " BUILD_CLAR=$build_clar " - D " LIBGIT2_FILENAME=$binaryFilename " .. }
113
117
Run- Command - Fatal { & $cmake -- build . -- config $configuration }
114
118
if ($test.IsPresent ) { Run- Command - Quiet - Fatal { & $ctest - V . } }
@@ -122,7 +126,7 @@ try {
122
126
}
123
127
124
128
if ($x64.IsPresent ) {
125
- Write-Output " Building 64-bit ..."
129
+ Write-Output " Building x64 ..."
126
130
Run- Command - Quiet { & mkdir build64 }
127
131
cd build64
128
132
Run- Command - Fatal { & $cmake - G " Visual Studio 16 2019" - A x64 - D THREADSAFE= ON - D USE_SSH= OFF - D ENABLE_TRACE= ON - D " BUILD_CLAR=$build_clar " - D " LIBGIT2_FILENAME=$binaryFilename " ../ .. }
@@ -136,6 +140,21 @@ try {
136
140
Run- Command - Quiet - Fatal { & copy - fo * $x64Directory - Exclude * .lib }
137
141
}
138
142
143
+ if ($arm64.IsPresent ) {
144
+ Write-Output " Building arm64..."
145
+ Run- Command - Quiet { & mkdir buildarm64 }
146
+ cd buildarm64
147
+ Run- Command - Fatal { & $cmake - G " Visual Studio 16 2019" - A ARM64 - D THREADSAFE= ON - D USE_SSH= OFF - D ENABLE_TRACE= ON - D " BUILD_CLAR=$build_clar " - D " LIBGIT2_FILENAME=$binaryFilename " ../ .. }
148
+ Run- Command - Fatal { & $cmake -- build . -- config $configuration }
149
+ if ($test.IsPresent ) { Run- Command - Quiet - Fatal { & $ctest - V . } }
150
+ cd $configuration
151
+ Assert-Consistent - Naming " $binaryFilename .dll" " *.dll"
152
+ Run- Command - Quiet { & rm * .exp }
153
+ Run- Command - Quiet { & rm $arm64Directory \* - ErrorAction Ignore }
154
+ Run- Command - Quiet { & mkdir - fo $arm64Directory }
155
+ Run- Command - Quiet - Fatal { & copy - fo * $arm64Directory - Exclude * .lib }
156
+ }
157
+
139
158
Write-Output " Done!"
140
159
}
141
160
finally {
0 commit comments