msvc-build.bat 971 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. @echo off
  2. rem Copyright (C) 2008-2012 Alon Bar-Lev <alon.barlev@gmail.com>
  3. @rem this stupid command needed for SetEnv.cmd to operate
  4. setlocal ENABLEDELAYEDEXPANSION
  5. cd /d %0\..
  6. call msvc-env.bat
  7. set PLATFORMS=Win32
  8. set CONFIGURATIONS=Release
  9. if exist "%VCHOME%\vcvarsall.bat" (
  10. call "%VCHOME%\vcvarsall.bat"
  11. ) else if exist "%VCHOME%\bin\vcvars32.bat" (
  12. call "%VCHOME%\bin\vcvars32.bat"
  13. ) else (
  14. echo Cannot detect visual studio
  15. goto error
  16. )
  17. msbuild /help > nul 2>&1
  18. if errorlevel 1 set DO_VCBUILD=1
  19. for %%p in (%PLATFORMS%) do (
  20. for %%c in (%CONFIGURATIONS%) do (
  21. rmdir /q /s %SOURCEBASE%\%%p\%%c > nul 2>&1
  22. if "%DO_VCBUILD%" NEQ "" (
  23. vcbuild /errfile:error.log /showenv "%SOLUTION%" /rebuild /platform:%%p "%%c|%%p"
  24. for %%f in (error.log) do if %%~zf GTR 0 goto error
  25. ) else (
  26. msbuild "%SOLUTION%" /p:Configuration="%%c" /p:Platform="%%p"
  27. if errorlevel 1 goto error
  28. )
  29. )
  30. )
  31. exit /b 0
  32. goto end
  33. :error
  34. exit /b 1
  35. goto end
  36. :end
  37. endlocal