Skip to content

Commit

Permalink
Merge branch 'arizvisa-GH-46'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefantalpalaru committed Sep 8, 2019
2 parents d096a7a + fe69a05 commit 0370735
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
32 changes: 19 additions & 13 deletions PCbuild/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo.version(s) of Microsoft Visual Studio to be installed (see readme.txt).
echo.
echo.After the flags recognized by this script, up to 9 arguments to be passed
echo.directly to MSBuild may be passed. If the argument contains an '=', the
echo.entire argument must be quoted (e.g. `%~nx0 "/p:PlatformToolset=v100"`).
echo.entire argument must be quoted (e.g. `%~nx0 "-p:PlatformToolset=v100"`).
echo.Alternatively you can put extra flags for MSBuild in a file named
echo.`msbuild.rsp` in the `PCbuild` directory, one flag per line. This file
echo.will be picked automatically by MSBuild. Flags put in this file does not
Expand Down Expand Up @@ -45,6 +45,9 @@ echo. -t Build ^| Rebuild ^| Clean ^| CleanAll
echo. Set the target manually
echo. --pgo-job The job to use for PGO training; implies --pgo
echo. (default: "-m test.regrtest --pgo")
echo. --platform-toolset v90 ^| v110 ^| v120 ^| v140
echo. Specify the platform toolset to use
echo. (default: v90)
exit /b 127

:Run
Expand All @@ -54,10 +57,11 @@ set conf=Release
set target=Build
set dir=%~dp0
set parallel=
set verbose=/nologo /v:m
set verbose=-nologo -v:m
set kill=
set do_pgo=
set pgo_job=-m test.regrtest --pgo
set PlatformToolset=v90

:CheckOpts
if "%~1"=="-h" goto Usage
Expand All @@ -66,9 +70,9 @@ if "%~1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
if "%~1"=="-r" (set target=Rebuild) & shift & goto CheckOpts
if "%~1"=="-t" (set target=%2) & shift & shift & goto CheckOpts
if "%~1"=="-d" (set conf=Debug) & shift & goto CheckOpts
if "%~1"=="-m" (set parallel=/m) & shift & goto CheckOpts
if "%~1"=="-m" (set parallel=-m) & shift & goto CheckOpts
if "%~1"=="-M" (set parallel=) & shift & goto CheckOpts
if "%~1"=="-v" (set verbose=/v:n) & shift & goto CheckOpts
if "%~1"=="-v" (set verbose=-v:n) & shift & goto CheckOpts
if "%~1"=="-k" (set kill=true) & shift & goto CheckOpts
if "%~1"=="--pgo" (set do_pgo=true) & shift & goto CheckOpts
if "%~1"=="--pgo-job" (set do_pgo=true) & (set pgo_job=%~2) & shift & shift & goto CheckOpts
Expand All @@ -79,6 +83,7 @@ if "%~1"=="-e" (set IncludeExternals=true) & shift & goto CheckOpts
if "%~1"=="--no-ssl" (set IncludeSSL=false) & shift & goto CheckOpts
if "%~1"=="--no-tkinter" (set IncludeTkinter=false) & shift & goto CheckOpts
if "%~1"=="--no-bsddb" (set IncludeBsddb=false) & shift & goto CheckOpts
if "%~1"=="--platform-toolset" (set PlatformToolset=%2) & shift & shift & goto CheckOpts

if "%IncludeExternals%"=="" set IncludeExternals=false
if "%IncludeSSL%"=="" set IncludeSSL=true
Expand All @@ -97,7 +102,7 @@ if "%do_pgo%" EQU "true" if "%platf%" EQU "x64" (
)

if "%GIT%" EQU "" set GIT=git
if exist "%GIT%" set GITProperty=/p:GIT="%GIT%"
if exist "%GIT%" set GITProperty=-p:GIT="%GIT%"

rem Setup the environment
call "%dir%find_msbuild.bat" %MSBUILD%
Expand All @@ -121,9 +126,9 @@ goto Build

:Kill
echo on
%MSBUILD% "%dir%\pythoncore.vcxproj" /t:KillPython %verbose%^
/p:Configuration=%conf% /p:Platform=%platf%^
/p:KillPython=true
%MSBUILD% "%dir%\pythoncore.vcxproj" -t:KillPython %verbose%^
-p:Configuration=%conf% -p:Platform=%platf%^
-p:KillPython=true

@echo off
goto :eof
Expand All @@ -133,11 +138,12 @@ rem Call on MSBuild to do the work, echo the command.
rem Passing %1-9 is not the preferred option, but argument parsing in
rem batch is, shall we say, "lackluster"
echo on
%MSBUILD% "%dir%pcbuild.proj" /t:%target% %parallel% %verbose%^
/p:Configuration=%conf% /p:Platform=%platf%^
/p:IncludeExternals=%IncludeExternals%^
/p:IncludeSSL=%IncludeSSL% /p:IncludeTkinter=%IncludeTkinter%^
/p:IncludeBsddb=%IncludeBsddb% %GITProperty%^
%MSBUILD% "%dir%pcbuild.proj" -t:%target% %parallel% %verbose%^
-p:Configuration=%conf% -p:Platform=%platf%^
-p:IncludeExternals=%IncludeExternals%^
-p:IncludeSSL=%IncludeSSL% -p:IncludeTkinter=%IncludeTkinter% -p:IncludeBsddb=%IncludeBsddb%^
-p:PlatformToolset=%PlatformToolset%^
%GITProperty%^
%1 %2 %3 %4 %5 %6 %7 %8 %9

@echo off
Expand Down
2 changes: 1 addition & 1 deletion PCbuild/env.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ echo.
rem Set up the v90 tools first. This is mostly needed to allow PGInstrument
rem builds to find the PGO DLL. Do it first so the newer MSBuild is found
rem before the one from v90 (vcvarsall.bat prepends to PATH).
call "%VS90COMNTOOLS%..\..\VC\vcvarsall.bat" %*

set VSTOOLS=%VS140COMNTOOLS%
if "%VSTOOLS%"=="" set VSTOOLS=%VS120COMNTOOLS%
if "%VSTOOLS%"=="" set VSTOOLS=%VS110COMNTOOLS%
if "%VSTOOLS%"=="" set VSTOOLS=%VS100COMNTOOLS%
if "%VSTOOLS%"=="" set VSTOOLS=%VS90COMNTOOLS%
call "%VSTOOLS%..\..\VC\vcvarsall.bat" %*

0 comments on commit 0370735

Please sign in to comment.