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.
 
 
 
 

62 lines
1.7 KiB

  1. rd /s /q vc
  2. git clone --depth 1 --quiet https://gitdab.com/vorelang/vc
  3. gcc -std=gnu11 -DUNICODE -D_UNICODE -w -o v2.exe vc/v_win.c
  4. v2.exe -o v.exe compiler
  5. if %ERRORLEVEL% GEQ 1 (
  6. echo v.exe failed to compile itself - Create an issue at 'https://gitdab.com/vorelang'
  7. exit /b 1
  8. )
  9. if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
  10. call "%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64 -no_logo
  11. ) else (
  12. goto :nocompiler
  13. )
  14. 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
  15. if %ERRORLEVEL% GEQ 1 (
  16. echo cl.exe failed to build V
  17. goto :compileerror
  18. )
  19. echo rebuild from source
  20. v2.exe -os msvc -o v.exe compiler
  21. if %ERRORLEVEL% GEQ 1 (
  22. echo V failed to build itself
  23. goto :compileerror
  24. )
  25. del v2.exe
  26. rd /s /q vc
  27. goto :success
  28. :nocompiler
  29. echo You do not appear to have a GCC installation on your PATH and also do not have an MSVC installation
  30. echo - this means that you cannot bootstrap a V installation at this time...
  31. echo.
  32. echo Head to 'https://github.com/vlang/v/releases/download/v0.1.10/mingw-w64-install.exe' to download and install GCC
  33. echo or head to 'https://visualstudio.microsoft.com/downloads/' to download and install MSVC
  34. echo (look for the Build Tools if you don't want to install the Visual Studio IDE)
  35. echo.
  36. goto :error
  37. :compileerror
  38. echo Failed to compile - Create an issue at 'https://github.com/vlang' and tag '@emily33901'!
  39. goto :error
  40. :error
  41. echo Exiting from error
  42. exit /b 1
  43. :success
  44. dir
  45. if exist "v.exe" (
  46. echo V has been successfully built
  47. exit
  48. ) else (
  49. echo v.exe was not generated - Create an issue at 'https://gitdab.com/vorelang'
  50. exit /b 1
  51. )