From b46be825deb7c451ae2780f9303659bd23412c1c Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 23 Oct 2023 13:50:53 -0600 Subject: [PATCH] add Git submodule update to `build.bat` (#739) 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