Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6732343

Browse files
committed
Turn 'rem' comments into a real usage message in PCbuild/build.bat
Also fixes error in 'kill' target (already fixed in 2.7, somehow the fix didn't make it to this branch).
1 parent 2051b84 commit 6732343

1 file changed

Lines changed: 36 additions & 15 deletions

File tree

PCbuild/build.bat

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
11
@echo off
2-
rem A batch program to build or rebuild a particular configuration,
3-
rem just for convenience.
4-
5-
rem Arguments:
6-
rem -c Set the configuration (default: Release)
7-
rem -p Set the platform (x64 or Win32, default: Win32)
8-
rem -r Target Rebuild instead of Build
9-
rem -t Set the target manually (Build, Rebuild, Clean, or CleanAll)
10-
rem -d Set the configuration to Debug
11-
rem -e Pull in external libraries using get_externals.bat
12-
rem -m Enable parallel build (enabled by default)
13-
rem -M Disable parallel build
14-
rem -v Increased output messages
15-
rem -k Attempt to kill any running Pythons before building (usually unnecessary)
2+
goto Run
3+
:Usage
4+
echo.%~nx0 [flags and arguments] [quoted MSBuild options]
5+
echo.
6+
echo.Build CPython from the command line. Requires the appropriate
7+
echo.version(s) of Microsoft Visual Studio to be installed (see readme.txt).
8+
echo.Also requires Subversion (svn.exe) to be on PATH if the '-e' flag is
9+
echo.given.
10+
echo.
11+
echo.After the flags recognized by this script, up to 9 arguments to be passed
12+
echo.directly to MSBuild may be passed. If the argument contains an '=', the
13+
echo.entire argument must be quoted (e.g. `%~nx0 "/p:PlatformToolset=v100"`)
14+
echo.
15+
echo.Available flags:
16+
echo. -h Display this help message
17+
echo. -V Display version information for the current build
18+
echo. -r Target Rebuild instead of Build
19+
echo. -d Set the configuration to Debug
20+
echo. -e Build external libraries fetched by get_externals.bat
21+
echo. -m Enable parallel build (enabled by default)
22+
echo. -M Disable parallel build
23+
echo. -v Increased output messages
24+
echo. -k Attempt to kill any running Pythons before building (usually done
25+
echo. automatically by the pythoncore project)
26+
echo.
27+
echo.Available arguments:
28+
echo. -c Release ^| Debug ^| PGInstrument ^| PGUpdate
29+
echo. Set the configuration (default: Release)
30+
echo. -p x64 ^| Win32
31+
echo. Set the platform (default: Win32)
32+
echo. -t Build ^| Rebuild ^| Clean ^| CleanAll
33+
echo. Set the target manually
34+
exit /b 127
1635

36+
:Run
1737
setlocal
1838
set platf=Win32
1939
set vs_platf=x86
@@ -25,6 +45,7 @@ set verbose=/nologo /v:m
2545
set kill=
2646

2747
:CheckOpts
48+
if "%~1"=="-h" goto Usage
2849
if "%~1"=="-c" (set conf=%2) & shift & shift & goto CheckOpts
2950
if "%~1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
3051
if "%~1"=="-r" (set target=Rebuild) & shift & goto CheckOpts
@@ -43,7 +64,7 @@ rem Setup the environment
4364
call "%dir%env.bat" %vs_platf% >nul
4465

4566
if "%kill%"=="true" (
46-
msbuild /v:m /nologo /target:KillPython "%pcbuild%\pythoncore.vcxproj" /p:Configuration=%conf% /p:Platform=%platf% /p:KillPython=true
67+
msbuild /v:m /nologo /target:KillPython "%dir%\pythoncore.vcxproj" /p:Configuration=%conf% /p:Platform=%platf% /p:KillPython=true
4768
)
4869

4970
rem Call on MSBuild to do the work, echo the command.

0 commit comments

Comments
 (0)