fix make.bat

pull/1817/head
Alexander Medvednikov 2019-09-01 16:43:40 +03:00
parent 24fdefe152
commit 847b43f6e4
1 changed files with 8 additions and 7 deletions

View File

@ -7,17 +7,18 @@ if exist "vc" (
) )
git version git version
echo Downloading v.c...
git clone --depth 1 --quiet https://github.com/vlang/vc git clone --depth 1 --quiet https://github.com/vlang/vc
REM option to force msvc or gcc REM option to force msvc or gcc
if "%~1"=="-gcc" goto :gccstrap if "%~1"=="-gcc" goto :gccstrap
if "%~1"=="-msvc" goto :msvcstrap if "%~1"=="-msvc" goto :msvcstrap
goto :msvcstrap
:gccstrap :gccstrap
echo attempting to bootstrap with GCC echo Attempting to build v.c with GCC...
for /f "usebackq tokens=*" %%i in (`where gcc`) do ( for /f "usebackq tokens=*" %%i in (`where gcc`) do (
set gccpath=%%i set gccpath=%%i
@ -36,7 +37,7 @@ if %ERRORLEVEL% GEQ 1 (
echo Building v.v... echo Building v.v...
v2.exe -o v.exe compiler v2.exe -o v.exe compiler
if %ERRORLEVEL% GEQ 1 ( if %ERRORLEVEL% GEQ 1 (
echo v.exe failed to compile itself - Create an issue at 'https://github.com/vlang' echo v.exe failed to compile itself - Create an issue at 'https://github.com/vlang'
exit /b 1 exit /b 1
) )
@ -47,7 +48,7 @@ goto :success
:msvcstrap :msvcstrap
echo Attempting to bootstrap with MSVC echo Attempting to build v.c with MSVC...
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set InstallDir=%%i set InstallDir=%%i
@ -99,9 +100,9 @@ exit /b 1
:success :success
dir dir
if exist "v.exe" ( if exist "v.exe" (
echo V has been successfully built echo V has been successfully built
exit exit
) else ( ) else (
echo v.exe was not generated - Create an issue at 'https://github.com/vlang' echo v.exe was not generated - Create an issue at 'https://github.com/vlang'
exit /b 1 exit /b 1
) )