Skip to content

Commit

Permalink
add Git submodule update to build.bat (#739)
Browse files Browse the repository at this point in the history
Make the Windows build script `build.bat` more like `configure` by
updating Git submodules unless an `/as-is` flag is provided.
  • Loading branch information
mflatt committed Oct 23, 2023
1 parent 8025557 commit b46be82
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set RUNTIMEAS=dll
set SRCDIR=%~dp0
set MAKETARGET=all-dlls
set SKIPVS=no
set SKIPSUBMODULE=no

if "%WORKAREA%"=="" goto needargument

Expand All @@ -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
)
Expand All @@ -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
Expand Down

0 comments on commit b46be82

Please sign in to comment.