FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Updated Windows build script to be able to build from command line · srpg/Source.Python@5562501 · GitHub

Repository navigation

Commit 5562501

Browse files
committed
Updated Windows build script to be able to build from command line
1 parent 48c00ea commit 5562501

1 file changed

Lines changed: 36 additions & 4 deletions

File tree

‎src/Build.bat‎

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,37 @@
11
@echo off
22

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+
312
:: Set the start directory for later reference
413
set STARTDIR="%CD%"
514

615
:: Allow the use of delayed expansion
716
setlocal EnableDelayedExpansion
817

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
935

1036
:: A function to choose the branch to build against
1137
:ChooseBranch
@@ -118,8 +144,12 @@ setlocal EnableDelayedExpansion
118144
:: Create the build files
119145
cmake . -B%BUILDDIR% -G"Visual Studio 10" -DBRANCH=%branch%
120146

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+
)
123153

124154
:: Exit the program
125155
exit
@@ -131,5 +161,7 @@ setlocal EnableDelayedExpansion
131161
:: Send an error message
132162
echo Encountered Error # %ERRORLEVEL%
133163

134-
:: Pause to show the error
135-
pause
164+
if %use_msbuild% == 0 (
165+
:: Pause to show the error
166+
pause
167+
)

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL