Skip to content

Commit be12449

Browse files
committed
Misc work on Windows arm64 support
Signed-off-by: Dennis Ameling <[email protected]>
1 parent cfde0ba commit be12449

File tree

4 files changed

+25
-12
lines changed

4 files changed

+25
-12
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ jobs:
164164
NO_PERL: 1
165165
GIT_CONFIG_PARAMETERS: "'user.name=CI' 'user.email=ci@git'"
166166
runs-on: windows-latest
167+
strategy:
168+
matrix:
169+
arch: [x64, arm64]
167170
steps:
168171
- uses: actions/checkout@v1
169172
- name: download git-sdk-64-minimal
@@ -182,6 +185,7 @@ jobs:
182185
unzip artifacts.zip
183186
rm artifacts.zip
184187
- name: download vcpkg artifacts
188+
if: matrix.arch == 'x64'
185189
shell: powershell
186190
run: |
187191
$urlbase = "https://dev.azure.com/git/git/_apis/build/builds"
@@ -195,16 +199,16 @@ jobs:
195199
- name: copy dlls to root
196200
shell: powershell
197201
run: |
198-
& compat\vcbuild\vcpkg_copy_dlls.bat release
202+
& compat\vcbuild\vcpkg_copy_dlls.bat release ${{ matrix.arch }}-windows
199203
if (!$?) { exit(1) }
200204
- name: generate Visual Studio solution
201205
shell: bash
202206
run: |
203-
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows \
204-
-DIconv_LIBRARY=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/lib/libiconv.lib -DIconv_INCLUDE_DIR=`pwd`/compat/vcbuild/vcpkg/installed/x64-windows/include \
205-
-DMSGFMT_EXE=`pwd`/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON
207+
cmake `pwd`/contrib/buildsystems/ -DCMAKE_PREFIX_PATH=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows \
208+
-DIconv_LIBRARY=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows/lib/libiconv.lib -DIconv_INCLUDE_DIR=`pwd`/compat/vcbuild/vcpkg/installed/${{ matrix.arch }}-windows/include \
209+
-DMSGFMT_EXE=`pwd`/git-sdk-64-minimal/mingw64/bin/msgfmt.exe -DPERL_TESTS=OFF -DPYTHON_TESTS=OFF -DCURL_NO_CURL_CMAKE=ON -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DVCPKG_ARCH=${{ matrix.arch }}-windows
206210
- name: MSBuild
207-
run: msbuild git.sln -property:Configuration=Release -property:Platform=x64 -maxCpuCount:4 -property:PlatformToolset=v142
211+
run: msbuild git.sln -property:Configuration=Release -property:Platform=${{ matrix.arch }} -maxCpuCount:4 -property:PlatformToolset=v142
208212
- name: bundle artifact tar
209213
shell: powershell
210214
env:
@@ -218,7 +222,7 @@ jobs:
218222
- name: upload build artifacts
219223
uses: actions/upload-artifact@v1
220224
with:
221-
name: vs-artifacts
225+
name: vs-artifacts-${{ matrix.arch }}
222226
path: artifacts
223227
vs-test:
224228
runs-on: windows-latest
@@ -236,7 +240,7 @@ jobs:
236240
- name: download build artifacts
237241
uses: actions/download-artifact@v1
238242
with:
239-
name: vs-artifacts
243+
name: vs-artifacts-x64
240244
path: ${{github.workspace}}
241245
- name: extract build artifacts
242246
shell: bash

compat/vcbuild/README

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ The Steps to Build Git with VS2015 or VS2017 from the command line.
66
Prompt or from an SDK bash window:
77

88
$ cd <repo_root>
9-
$ ./compat/vcbuild/vcpkg_install.bat
9+
$ ./compat/vcbuild/vcpkg_install.bat x64-windows
10+
11+
or
12+
13+
$ ./compat/vcbuild/vcpkg_install.bat arm64-windows
1014

1115
The vcpkg tools and all of the third-party sources will be installed
1216
in this folder:

compat/vcbuild/vcpkg_copy_dlls.bat

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ REM ================================================================
1515
@FOR /F "delims=" %%D IN ("%~dp0") DO @SET cwd=%%~fD
1616
cd %cwd%
1717

18-
SET arch=x64-windows
18+
SET arch=%2
19+
IF NOT DEFINED arch (
20+
echo defaulting to 'x64-windows`. Invoke %0 with 'x86-windows', 'x64-windows', or 'arm64-windows'
21+
set arch=x64-windows
22+
)
23+
1924
SET inst=%cwd%vcpkg\installed\%arch%
2025

2126
IF [%1]==[release] (

contrib/buildsystems/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ if(WIN32)
5252
set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg")
5353
if(MSVC AND NOT EXISTS ${VCPKG_DIR})
5454
message("Initializing vcpkg and building the Git's dependencies (this will take a while...)")
55-
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat)
55+
execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat ${VCPKG_ARCH})
5656
endif()
57-
list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/x64-windows")
57+
list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/${VCPKG_ARCH}")
5858

5959
# In the vcpkg edition, we need this to be able to link to libcurl
6060
set(CURL_NO_CURL_CMAKE ON)
@@ -954,7 +954,7 @@ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_GETTEXT='${NO_GETTEXT}'\n"
954954
file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "RUNTIME_PREFIX='${RUNTIME_PREFIX}'\n")
955955
file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PYTHON='${NO_PYTHON}'\n")
956956
if(WIN32)
957-
file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n")
957+
file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/${VCPKG_ARCH}/bin\"\n")
958958
endif()
959959

960960
#Make the tests work when building out of the source tree

0 commit comments

Comments
 (0)