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.
 
 
 
 

60 lines
1.3 KiB

  1. @echo off
  2. set exiterror=0
  3. echo finding an MSVC installation
  4. 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 (
  5. set InstallDir=%%i
  6. )
  7. REM set up a devcmd
  8. if exist "%InstallDir%\Common7\Tools\vsdevcmd.bat" (
  9. call "%InstallDir%\Common7\Tools\vsdevcmd.bat" -arch=x64 -host_arch=x64
  10. ) else (
  11. goto :nomsvc
  12. )
  13. echo fetch v_win.c
  14. curl -O https://gitdab.com/vorelang/vc/raw/branch/master/v_win.c
  15. echo build v_win.c with msvc
  16. cl.exe /w /volatile:ms /D_UNICODE /DUNICODE /D_BOOTSTRAP_NO_UNICODE_STREAM /Fo.v_win.c.obj /O2 /MD v_win.c user32.lib kernel32.lib advapi32.lib shell32.lib /link /DEBUG:NONE /NOLOGO /OUT:v2.exe /INCREMENTAL:NO
  17. if %ERRORLEVEL% GEQ 1 (
  18. goto :compileerror
  19. )
  20. echo rebuild from source
  21. v2.exe -os msvc -o v.exe compiler
  22. if %ERRORLEVEL% GEQ 1 (
  23. goto :compileerror
  24. )
  25. dir v_win.c v2.exe v.exe
  26. del .v_win.c.obj
  27. del v_win.c
  28. del v2.exe
  29. echo Vore has been built.
  30. :nomsvc
  31. echo Cannot find an msvc installation
  32. goto :error
  33. :compileerror
  34. echo Failed to compile - Create an issue at 'https://gitdab.com/vorelang/vorelang/issues'!
  35. goto :error
  36. :error
  37. echo fail
  38. exit /b 1
  39. :done
  40. echo pass