Skip to content

Commit 06a6f19

Browse files
manbeariandennisameling
authored andcommitted
update vcpkg_install.bat to support 'features'
Signed-off-by: Dennis Ameling <[email protected]>
1 parent 0489a4f commit 06a6f19

File tree

1 file changed

+42
-3
lines changed

1 file changed

+42
-3
lines changed

compat/vcbuild/vcpkg_install.bat

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@ECHO OFF
1+
@IF NOT DEFINED _ECHO ECHO OFF
22
REM ================================================================
33
REM This script installs the "vcpkg" source package manager and uses
44
REM it to build the third-party libraries that git requires when it
@@ -32,7 +32,10 @@ REM ================================================================
3232
SETLOCAL EnableDelayedExpansion
3333

3434
SET arch=%1
35-
if not defined arch=x64-windows
35+
IF NOT DEFINED arch (
36+
echo defaulting to 'x64-windows`. Invoke %0 with 'x86-windows', 'x64-windows', or 'arm64-windows'
37+
set arch=x64-windows
38+
)
3639

3740
@FOR /F "delims=" %%D IN ("%~dp0") DO @SET cwd=%%~fD
3841
cd %cwd%
@@ -82,14 +85,50 @@ REM ================================================================
8285
:sub__install_one
8386
echo Installing package %1...
8487

88+
call :%1_features
89+
8590
REM vcpkg may not be reliable on slow, intermittent or proxy
8691
REM connections, see e.g.
8792
REM https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/4a8f7be5-5e15-4213-a7bb-ddf424a954e6/winhttpsendrequest-ends-with-12002-errorhttptimeout-after-21-seconds-no-matter-what-timeout?forum=windowssdk
8893
REM which explains the hidden 21 second timeout
8994
REM (last post by Dave : Microsoft - Windows Networking team)
9095

91-
.\vcpkg.exe install %1:%arch%
96+
.\vcpkg.exe install %1%features%:%arch%
9297
IF ERRORLEVEL 1 ( EXIT /B 1 )
9398

9499
echo Finished %1
95100
goto :EOF
101+
102+
103+
104+
::
105+
:: features for each vcpkg to install
106+
:: there should be an entry here for each package to install
107+
:: 'set features=' means use the default otherwise
108+
:: 'set features=[comma-delimited-feature-set]' is the syntax
109+
::
110+
111+
:zlib_features
112+
set features=
113+
goto :EOF
114+
115+
:expat_features
116+
set features=
117+
goto :EOF
118+
119+
:libiconv_features
120+
set features=
121+
goto :EOF
122+
123+
:openssl_features
124+
set features=
125+
goto :EOF
126+
127+
:libssh2_features
128+
set features=
129+
goto :EOF
130+
131+
:curl_features
132+
set features=[core,openssl]
133+
goto :EOF
134+

0 commit comments

Comments
 (0)