Skip to content

Commit

Permalink
vcbuild: install ARM64 dependencies when building ARM64 binaries
Browse files Browse the repository at this point in the history
Co-authored-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Ian Bearman <ianb@microsoft.com>
Signed-off-by: Dennis Ameling <dennis@dennisameling.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
2 people authored and dscho committed Sep 24, 2024
1 parent 3a2a268 commit e1cdf71
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
6 changes: 5 additions & 1 deletion compat/vcbuild/README
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ The Steps to Build Git with VS2015 or VS2017 from the command line.
Prompt or from an SDK bash window:

$ cd <repo_root>
$ ./compat/vcbuild/vcpkg_install.bat
$ ./compat/vcbuild/vcpkg_install.bat x64-windows

or

$ ./compat/vcbuild/vcpkg_install.bat arm64-windows

The vcpkg tools and all of the third-party sources will be installed
in this folder:
Expand Down
7 changes: 6 additions & 1 deletion compat/vcbuild/vcpkg_copy_dlls.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ REM ================================================================
@FOR /F "delims=" %%D IN ("%~dp0") DO @SET cwd=%%~fD
cd %cwd%

SET arch=x64-windows
SET arch=%2
IF NOT DEFINED arch (
echo defaulting to 'x64-windows`. Invoke %0 with 'x86-windows', 'x64-windows', or 'arm64-windows'
set arch=x64-windows
)

SET inst=%cwd%vcpkg\installed\%arch%

IF [%1]==[release] (
Expand Down
9 changes: 7 additions & 2 deletions compat/vcbuild/vcpkg_install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ REM ================================================================

SETLOCAL EnableDelayedExpansion

SET arch=%1
IF NOT DEFINED arch (
echo defaulting to 'x64-windows`. Invoke %0 with 'x86-windows', 'x64-windows', or 'arm64-windows'
set arch=x64-windows
)

@FOR /F "delims=" %%D IN ("%~dp0") DO @SET cwd=%%~fD
cd %cwd%

Expand All @@ -55,9 +61,8 @@ REM ================================================================
echo Successfully installed %cwd%vcpkg\vcpkg.exe

:install_libraries
SET arch=x64-windows

echo Installing third-party libraries...
echo Installing third-party libraries(%arch%)...
FOR %%i IN (zlib expat libiconv openssl libssh2 curl) DO (
cd %cwd%vcpkg
IF NOT EXIST "packages\%%i_%arch%" CALL :sub__install_one %%i
Expand Down
2 changes: 1 addition & 1 deletion contrib/buildsystems/Generators/Vcxproj.pm
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ EOM
<PreBuildEvent Condition="!Exists('$cdup\\compat\\vcbuild\\vcpkg\\installed\\\$(VCPKGArch)\\include\\openssl\\ssl.h')">
<Message>Initialize VCPKG</Message>
<Command>del "$cdup\\compat\\vcbuild\\vcpkg"</Command>
<Command>call "$cdup\\compat\\vcbuild\\vcpkg_install.bat"</Command>
<Command>call "$cdup\\compat\\vcbuild\\vcpkg_install.bat" \$(VCPKGArch)</Command>
</PreBuildEvent>
EOM
}
Expand Down

0 comments on commit e1cdf71

Please sign in to comment.