@@ -9,8 +9,10 @@ rem -r Target Rebuild instead of Build
99rem -t Set the target manually (Build, Rebuild, Clean, or CleanAll)
1010rem -d Set the configuration to Debug
1111rem -e Pull in external libraries using get_externals.bat
12+ rem -m Enable parallel build (enabled by default)
1213rem -M Disable parallel build
1314rem -v Increased output messages
15+ rem -k Attempt to kill any running Pythons before building (usually unnecessary)
1416
1517setlocal
1618set platf = Win32
@@ -20,6 +22,7 @@ set target=Build
2022set dir = %~dp0
2123set parallel = /m
2224set verbose = /nologo /v:m
25+ set kill =
2326
2427:CheckOpts
2528if '%1 '== '-c' (set conf=%2 ) & shift & shift & goto CheckOpts
@@ -28,14 +31,20 @@ if '%1'=='-r' (set target=Rebuild) & shift & goto CheckOpts
2831if '%1 '== '-t' (set target=%2 ) & shift & shift & goto CheckOpts
2932if '%1 '== '-d' (set conf=Debug) & shift & goto CheckOpts
3033if '%1 '== '-e' call " %dir% get_externals.bat" & shift & goto CheckOpts
34+ if '%1 '== '-m' (set parallel=/m) & shift & goto CheckOpts
3135if '%1 '== '-M' (set parallel=) & shift & goto CheckOpts
3236if '%1 '== '-v' (set verbose=/v:n) & shift & goto CheckOpts
37+ if '%1 '== '-k' (set kill=true) & shift & goto CheckOpts
3338
3439if '%platf% '== 'x64' (set vs_platf=x86_amd64)
3540
3641rem Setup the environment
3742call " %dir% env.bat" %vs_platf% > nul
3843
44+ if '%kill% '== 'true' (
45+ msbuild /v:m /nologo /target:KillPython " %pcbuild% \pythoncore.vcxproj" /p:Configuration=%conf% /p:Platform=%platf% /p:KillPython=true
46+ )
47+
3948rem Call on MSBuild to do the work, echo the command.
4049rem Passing %1-9 is not the preferred option, but argument parsing in
4150rem batch is, shall we say, "lackluster"
0 commit comments