all: support v -watch run (#9577)

This commit is contained in:
Delyan Angelov 2021-04-04 17:05:06 +03:00 committed by GitHub
parent 82f3ca2d55
commit c698fa1a58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 701 additions and 78 deletions

View file

@ -162,15 +162,7 @@ if !flag_local! NEQ 1 (
cd ..>>"!log_file!" 2>NUL
)
popd
) || (
echo Cloning vc...
echo ^> Cloning from remote !vc_url!
if !flag_verbose! EQU 1 (
echo [Debug] git clone --depth 1 --quiet %vc_url%>>"!log_file!"
echo git clone --depth 1 --quiet %vc_url%
)
git clone --depth 1 --quiet %vc_url%>>"!log_file!" 2>NUL
)
) || call :cloning_vc
echo.
)
@ -178,7 +170,6 @@ echo Building V...
if not [!compiler!] == [] goto :!compiler!_strap
REM By default, use tcc, since we have it prebuilt:
:tcc_strap
:tcc32_strap
@ -308,8 +299,6 @@ del %ObjFile%>>"!log_file!" 2>>&1
if %ERRORLEVEL% NEQ 0 goto :compile_error
goto :success
:download_tcc
pushd %tcc_dir% 2>NUL && (
echo Updating TCC
@ -320,16 +309,8 @@ pushd %tcc_dir% 2>NUL && (
)
git pull --quiet>>"!log_file!" 2>NUL
popd
) || (
echo Bootstraping TCC...
echo ^> TCC not found
if "!tcc_branch!" == "thirdparty-windows-i386" ( echo ^> Downloading TCC32 from !tcc_url! ) else ( echo ^> Downloading TCC64 from !tcc_url! )
if !flag_verbose! EQU 1 (
echo [Debug] git clone --depth 1 --quiet --single-branch --branch !tcc_branch! !tcc_url! "%tcc_dir%">>"!log_file!"
echo git clone --depth 1 --quiet --single-branch --branch !tcc_branch! !tcc_url! "%tcc_dir%"
)
git clone --depth 1 --quiet --single-branch --branch !tcc_branch! !tcc_url! "%tcc_dir%">>"!log_file!" 2>NUL
)
) || call :bootstrap_tcc
for /f "usebackq delims=" %%i in (`dir "%tcc_dir%" /b /a /s tcc.exe`) do (
set "attrib=%%~ai"
set "dattrib=%attrib:~0,1%"
@ -426,6 +407,27 @@ echo file
echo --verbose Output compilation commands to stdout
exit /b 0
:bootstrap_tcc
echo Bootstraping TCC...
echo ^> TCC not found
if "!tcc_branch!" == "thirdparty-windows-i386" ( echo ^> Downloading TCC32 from !tcc_url! ) else ( echo ^> Downloading TCC64 from !tcc_url! )
if !flag_verbose! EQU 1 (
echo [Debug] git clone --depth 1 --quiet --single-branch --branch !tcc_branch! !tcc_url! "%tcc_dir%">>"!log_file!"
echo git clone --depth 1 --quiet --single-branch --branch !tcc_branch! !tcc_url! "%tcc_dir%"
)
git clone --depth 1 --quiet --single-branch --branch !tcc_branch! !tcc_url! "%tcc_dir%">>"!log_file!" 2>NUL
exit /b 0
:cloning_vc
echo Cloning vc...
echo ^> Cloning from remote !vc_url!
if !flag_verbose! EQU 1 (
echo [Debug] git clone --depth 1 --quiet %vc_url%>>"!log_file!"
echo git clone --depth 1 --quiet %vc_url%
)
git clone --depth 1 --quiet %vc_url%>>"!log_file!" 2>NUL
exit /b 0
:eof
popd
endlocal