vorelang programming language
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

61 lines
1.7 KiB

rd /s /q vc
git clone --depth 1 --quiet https://gitdab.com/vorelang/vc
gcc -std=gnu11 -DUNICODE -D_UNICODE -w -o v2.exe vc/v_win.c
v2.exe -o v.exe compiler
if %ERRORLEVEL% GEQ 1 (
echo v.exe failed to compile itself - Create an issue at 'https://gitdab.com/vorelang'
exit /b 1
)
if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
call "%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64 -no_logo
) else (
goto :nocompiler
)
cl.exe /nologo /w /volatile:ms /D_UNICODE /DUNICODE /Fo.v.c.obj /O2 /MD vc\v_win.c user32.lib kernel32.lib advapi32.lib shell32.lib /link /NOLOGO /OUT:v2.exe /INCREMENTAL:NO
if %ERRORLEVEL% GEQ 1 (
echo cl.exe failed to build V
goto :compileerror
)
echo rebuild from source
v2.exe -os msvc -o v.exe compiler
if %ERRORLEVEL% GEQ 1 (
echo V failed to build itself
goto :compileerror
)
del v2.exe
rd /s /q vc
goto :success
:nocompiler
echo You do not appear to have a GCC installation on your PATH and also do not have an MSVC installation
echo - this means that you cannot bootstrap a V installation at this time...
echo.
echo Head to 'https://github.com/vlang/v/releases/download/v0.1.10/mingw-w64-install.exe' to download and install GCC
echo or head to 'https://visualstudio.microsoft.com/downloads/' to download and install MSVC
echo (look for the Build Tools if you don't want to install the Visual Studio IDE)
echo.
goto :error
:compileerror
echo Failed to compile - Create an issue at 'https://github.com/vlang' and tag '@emily33901'!
goto :error
:error
echo Exiting from error
exit /b 1
:success
dir
if exist "v.exe" (
echo V has been successfully built
exit
) else (
echo v.exe was not generated - Create an issue at 'https://gitdab.com/vorelang'
exit /b 1
)