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