| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,11 +1,37 @@ | |||
| 1 | 1 | @echo off | |
| 2 | 2 | ||
| 3 | + :: The branch name | ||
| 4 | + set branch=%1 | ||
| 5 | + | ||
| 6 | + :: Release = 1, Debug = 0 | ||
| 7 | + set build_type=%2 | ||
| 8 | + | ||
| 9 | + :: 0 = use interactive method, 1 = use msbuild | ||
| 10 | + set use_msbuild=0 | ||
| 11 | + | ||
| 3 | 12 | :: Set the start directory for later reference | |
| 4 | 13 | set STARTDIR="%CD%" | |
| 5 | 14 | ||
| 6 | 15 | :: Allow the use of delayed expansion | |
| 7 | 16 | setlocal EnableDelayedExpansion | |
| 8 | 17 | ||
| 18 | + :: If branch or build_type wasn't set, use the interactive method | ||
| 19 | + if [%branch%] == [] goto :ChooseBranch | ||
| 20 | + if [%build_type%] == [] goto :ChooseBranch | ||
| 21 | + | ||
| 22 | + :: Validate the build_type | ||
| 23 | + if %build_type% == 1 ( | ||
| 24 | + set use_msbuild=1 | ||
| 25 | + set build_type="Release" | ||
| 26 | + ) | ||
| 27 | + if %build_type% == 0 ( | ||
| 28 | + set use_msbuild=1 | ||
| 29 | + set build_type="Debug" | ||
| 30 | + ) | ||
| 31 | + | ||
| 32 | + :: If msbuild should be used, we already know the branch. | ||
| 33 | + :: -> Skip ChooseBranch | ||
| 34 | + if %use_msbuild% == 1 goto CloneRepo | ||
| 9 | 35 | ||
| 10 | 36 | :: A function to choose the branch to build against | |
| 11 | 37 | :ChooseBranch | |
@@ -118,8 +144,12 @@ setlocal EnableDelayedExpansion | |||
| 118 | 144 | :: Create the build files | |
| 119 | 145 | cmake . -B%BUILDDIR% -G"Visual Studio 10" -DBRANCH=%branch% | |
| 120 | 146 | ||
| 121 | - :: Pause to show the process is completed | ||
| 122 | - pause | ||
| 147 | + if %use_msbuild% == 1 ( | ||
| 148 | + msbuild %BUILDDIR%\source-python.sln /p:Configuration=%build_type% /p:VCTargetsPath="C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0" | ||
| 149 | + ) else ( | ||
| 150 | + :: Pause to show the process is completed | ||
| 151 | + pause | ||
| 152 | + ) | ||
| 123 | 153 | ||
| 124 | 154 | :: Exit the program | |
| 125 | 155 | exit | |
@@ -131,5 +161,7 @@ setlocal EnableDelayedExpansion | |||
| 131 | 161 | :: Send an error message | |
| 132 | 162 | echo Encountered Error # %ERRORLEVEL% | |
| 133 | 163 | ||
| 134 | - :: Pause to show the error | ||
| 135 | - pause | ||
| 164 | + if %use_msbuild% == 0 ( | ||
| 165 | + :: Pause to show the error | ||
| 166 | + pause | ||
| 167 | + ) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments