11
11
If set, the x64 version will be built.
12
12
. PARAMETER arm64
13
13
If set, the arm64 version will be built.
14
+ . PARAMETER arm64
15
+ If set, the arm64 version will be built.
14
16
#>
15
17
16
18
Param (
@@ -32,8 +34,8 @@ $hashFile = Join-Path $projectDirectory "nuget.package\libgit2\libgit2_hash.txt"
32
34
$sha = Get-Content $hashFile
33
35
$binaryFilename = " git2-" + $sha.Substring (0 , 7 )
34
36
35
- $build_clar = ' OFF'
36
- if ($test.IsPresent ) { $build_clar = ' ON' }
37
+ $build_tests = ' OFF'
38
+ if ($test.IsPresent ) { $build_tests = ' ON' }
37
39
38
40
$configuration = " Release"
39
41
if ($debug.IsPresent ) { $configuration = " Debug" }
@@ -102,6 +104,11 @@ function Assert-Consistent-Naming($expected, $path) {
102
104
}
103
105
104
106
try {
107
+ if ((! $x86.isPresent -and ! $x64.IsPresent ) -and ! $arm64.IsPresent ) {
108
+ Write-Output - Stderr " Error: usage $MyInvocation .MyCommand [-x86] [-x64] [-arm64]"
109
+ Exit
110
+ }
111
+
105
112
Push-Location $libgit2Directory
106
113
107
114
$cmake = Find-CMake
@@ -113,7 +120,7 @@ try {
113
120
114
121
if ($x86.IsPresent ) {
115
122
Write-Output " Building x86..."
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 " .. }
123
+ Run- Command - Fatal { & $cmake - A Win32 - D ENABLE_TRACE= ON - D USE_SSH= OFF - D " BUILD_TESTS= $build_tests " - D " BUILD_CLI=OFF " - D " LIBGIT2_FILENAME=$binaryFilename " .. }
117
124
Run- Command - Fatal { & $cmake -- build . -- config $configuration }
118
125
if ($test.IsPresent ) { Run- Command - Quiet - Fatal { & $ctest - V . } }
119
126
cd $configuration
@@ -129,7 +136,7 @@ try {
129
136
Write-Output " Building x64..."
130
137
Run- Command - Quiet { & mkdir build64 }
131
138
cd build64
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 " ../ .. }
139
+ Run- Command - Fatal { & $cmake - A x64 - D THREADSAFE= ON - D USE_SSH= OFF - D ENABLE_TRACE= ON - D " BUILD_TESTS= $build_tests " - D " BUILD_CLI=OFF " - D " LIBGIT2_FILENAME=$binaryFilename " ../ .. }
133
140
Run- Command - Fatal { & $cmake -- build . -- config $configuration }
134
141
if ($test.IsPresent ) { Run- Command - Quiet - Fatal { & $ctest - V . } }
135
142
cd $configuration
@@ -144,7 +151,7 @@ try {
144
151
Write-Output " Building arm64..."
145
152
Run- Command - Quiet { & mkdir buildarm64 }
146
153
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 " ../ .. }
154
+ Run- Command - Fatal { & $cmake - A ARM64 - D THREADSAFE= ON - D USE_SSH= OFF - D ENABLE_TRACE= ON - D " BUILD_TESTS= $build_tests " - D " BUILD_CLI=OFF " - D " LIBGIT2_FILENAME=$binaryFilename " ../ .. }
148
155
Run- Command - Fatal { & $cmake -- build . -- config $configuration }
149
156
if ($test.IsPresent ) { Run- Command - Quiet - Fatal { & $ctest - V . } }
150
157
cd $configuration
0 commit comments