From bc47d31777ee94ec67091a14f031836baa1e2859 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 21 Oct 2023 04:31:35 -0600 Subject: [PATCH] add Git submodule update to `build.bat` Make the Windows build script `build.bat` more like `configure` by updating Git submodules unless an `/as-is` flag is provided. --- build.bat | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build.bat b/build.bat index d08512f2d..b256b053b 100644 --- a/build.bat +++ b/build.bat @@ -8,6 +8,7 @@ set RUNTIMEAS=dll set SRCDIR=%~dp0 set MAKETARGET=all-dlls set SKIPVS=no +set SKIPSUBMODULE=no if "%WORKAREA%"=="" goto needargument @@ -29,6 +30,7 @@ if defined ARG ( if "%ARG%"=="/test" set MAKETARGET=test && goto argloop if "%ARG%"=="/test-more" set MAKETARGET=test-more && goto argloop if "%ARG%"=="/keepvs" set SKIPVS=yes && goto argloop + if "%ARG%"=="/as-is" set SKIPSUBMODULE=yes && goto argloop echo Unrecognized argument %ARG% exit /B 1 ) @@ -45,6 +47,13 @@ if "%VSCONFIG%"=="" ( exit /B 1 ) +if %SKIPSUBMODULE%==yes goto postsubmodule +if not exist .git goto postsubmodule +where git > NUL 2>&1 +if %ERRORLEVEL% neq 0 goto postsubmodule +git submodule update --init --depth 1 +:postsubmodule + if not exist %WORKAREA% mkdir %WORKAREA% echo srcdir=%SRCDIR% > %WORKAREA%\Mf-config