make.bat: change the default compiler to tcc (which we have prebuilt in a known location)

pull/9204/head
Delyan Angelov 2021-03-09 00:46:37 +02:00
parent a9358e4948
commit 343f144b0b
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 26 additions and 19 deletions

View File

@ -177,6 +177,31 @@ if !flag_local! NEQ 1 (
echo Building V...
if not [!compiler!] == [] goto :!compiler!_strap
REM By default, use tcc, since we have it prebuilt:
:tcc_strap
:tcc32_strap
if [!compiler!] == [] set /a invalid_cc=1
echo ^> Attempting to build v_win.c with TCC
if !flag_verbose! EQU 1 (
echo [Debug] "!tcc_exe!" -ladvapi32 -bt10 -w -o v.exe vc\v_win.c>>"!log_file!"
echo "!tcc_exe!" -ladvapi32 -bt10 -w -o v.exe vc\v_win.c
)
"!tcc_exe!" -ladvapi32 -bt10 -w -o v.exe vc\v_win.c>>"!log_file!" 2>NUL
if %ERRORLEVEL% NEQ 0 goto :compile_error
echo ^> Compiling with .\v.exe self
if !flag_verbose! EQU 1 (
echo [Debug] v.exe -cc "!tcc_exe!" self>>"!log_file!"
echo v.exe -cc "!tcc_exe!" self
)
v.exe -cc "!tcc_exe!" self>>"!log_file!" 2>NUL
if %ERRORLEVEL% NEQ 0 goto :clang_strap
goto :success
:clang_strap
where /q clang
if %ERRORLEVEL% NEQ 0 (
@ -247,7 +272,7 @@ if "%PROCESSOR_ARCHITECTURE%" == "x86" (
if not exist "%VsWhereDir%\Microsoft Visual Studio\Installer\vswhere.exe" (
echo ^> MSVC not found
if not [!compiler!] == [] goto :error
goto :tcc_strap
goto :compile_error
)
for /f "usebackq tokens=*" %%i in (`"%VsWhereDir%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
@ -284,25 +309,7 @@ del %ObjFile%>>"!log_file!" 2>>&1
if %ERRORLEVEL% NEQ 0 goto :compile_error
goto :success
:tcc_strap
:tcc32_strap
if [!compiler!] == [] set /a invalid_cc=1
echo ^> Attempting to build v_win.c with TCC
if !flag_verbose! EQU 1 (
echo [Debug] "!tcc_exe!" -ladvapi32 -bt10 -w -o v.exe vc\v_win.c>>"!log_file!"
echo "!tcc_exe!" -ladvapi32 -bt10 -w -o v.exe vc\v_win.c
)
"!tcc_exe!" -ladvapi32 -bt10 -w -o v.exe vc\v_win.c>>"!log_file!" 2>NUL
if %ERRORLEVEL% NEQ 0 goto :compile_error
echo ^> Compiling with .\v.exe self
if !flag_verbose! EQU 1 (
echo [Debug] v.exe -cc "!tcc_exe!" self>>"!log_file!"
echo v.exe -cc "!tcc_exe!" self
)
v.exe -cc "!tcc_exe!" self>>"!log_file!" 2>NUL
if %ERRORLEVEL% NEQ 0 goto :compile_error
goto :success
:download_tcc
pushd %tcc_dir% 2>NUL && (