Freeswitch.2015.sln.bat 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. @REM this script builds freeswitch using VS2015
  2. @REM only one platform/configuration will be built
  3. @REM runs (probably only) from the commandline
  4. @REM usage: Freeswitch.2015.sln [[[.*]ebug] [[.*]elease] [[.*]64] [[.*]32]]
  5. @REM e.g. Freeswitch.2015.sln Debug x64
  6. @REM Freeswitch.2015.sln x64
  7. @REM Freeswitch.2015.sln Debug
  8. @REM Freeswitch.2015.sln
  9. @setlocal
  10. @echo on
  11. @REM default build
  12. @REM change these variables if you want to build differently by default
  13. @set configuration=Release
  14. @set platform=Win32
  15. @REM if commandline parameters contain "ebug" and/or "64 and/or 32"
  16. @REM set the configuration/platform to Debug and/or x64 and/or 32
  17. @if "%1"=="" (
  18. @goto :paramsset
  19. )
  20. @set params=%*
  21. @set xparams=x%params: =%
  22. @if not y%xparams:ebug=%==y%xparams% (
  23. set configuration=Debug
  24. )
  25. @if not x%xparams:64=%==x%xparams% (
  26. set platform=x64
  27. )
  28. @if not x%xparams:32=%==x%xparams% (
  29. set platform=Win32
  30. )
  31. @if not y%xparams:elease=%==y%xparams% (
  32. set configuration=Debug
  33. )
  34. :paramsset
  35. @REM use all processors minus 1 when building
  36. @REM hmm, this doesn't seem to work as I expected as all my procs are used during the build
  37. @set procs=%NUMBER_OF_PROCESSORS%
  38. @set /a procs -= 1
  39. @REM check and set VS2015 environment
  40. @REM vcvars32.bat calls exit and will also exit whilie running this bat file ...
  41. @REM so you have to run it again if the VS2015 env is not yet set
  42. @if "%VS110COMNTOOLS%"=="" (
  43. goto :error_no_VS110COMNTOOLSDIR
  44. )
  45. @if "%VSINSTALLDIR%"=="" (
  46. goto :setvcvars
  47. )
  48. :build
  49. msbuild Freeswitch.2015.sln /m:%procs% /verbosity:normal /property:Configuration=%configuration% /property:Platform=%platform% /fl /flp:logfile=vs2015%platform%%configuration%.log;verbosity=normal
  50. @goto :end
  51. @REM -----------------------------------------------------------------------
  52. :setvcvars
  53. @endlocal
  54. @echo Now setting Visual Studio 2015 Environment
  55. @call "%VS110COMNTOOLS%vsvars32"
  56. @REM in order to prevent running vsvars32 multiple times and at the same time not
  57. @REM cluttering up the environment variables proc/configuration/platform
  58. @REM it is necessary to start the script again
  59. @echo Run the script %0 again (and/or open a command prompt)
  60. @goto :end
  61. :error_no_VS110COMNTOOLSDIR
  62. @echo ERROR: Cannot determine the location of the VS2015 Common Tools folder.
  63. @echo ERROR: Note this script will not work in a git bash environment
  64. @goto :end
  65. :end
  66. @pause
  67. @REM ------ terminate :end with LF otherwise the label is not recognized by the command processor -----