From 343f144b0b70b21773102bbeabfd12a78cc893da Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 9 Mar 2021 00:46:37 +0200 Subject: [PATCH] make.bat: change the default compiler to tcc (which we have prebuilt in a known location) --- make.bat | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/make.bat b/make.bat index 9255f3ad68..900771a310 100644 --- a/make.bat +++ b/make.bat @@ -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 && (