From 9e36589d49c1d6b06c0239fa69e8274d7e89e375 Mon Sep 17 00:00:00 2001 From: Anthony Shaw Date: Wed, 18 Dec 2019 08:21:20 +1100 Subject: [PATCH] bpo-36500: Add --regen option to PCbuild/build.bat so Windows users can regen grammar, opcodes, tokens and symbols (GH-12654) --- .../2019-04-02-01-59-26.bpo-36500.fyG6_U.rst | 2 + PCbuild/build.bat | 17 +- PCbuild/regen.vcxproj | 225 ++++++++++++++++++ 3 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Build/2019-04-02-01-59-26.bpo-36500.fyG6_U.rst create mode 100644 PCbuild/regen.vcxproj diff --git a/Misc/NEWS.d/next/Build/2019-04-02-01-59-26.bpo-36500.fyG6_U.rst b/Misc/NEWS.d/next/Build/2019-04-02-01-59-26.bpo-36500.fyG6_U.rst new file mode 100644 index 00000000000..cd230e4069e --- /dev/null +++ b/Misc/NEWS.d/next/Build/2019-04-02-01-59-26.bpo-36500.fyG6_U.rst @@ -0,0 +1,2 @@ +Added an optional "regen" project to the Visual Studio solution that will +regenerate all grammar, tokens, and opcodes. diff --git a/PCbuild/build.bat b/PCbuild/build.bat index 623409c24ec..5bc5da9e1c9 100644 --- a/PCbuild/build.bat +++ b/PCbuild/build.bat @@ -32,6 +32,7 @@ echo. automatically by the pythoncore project) echo. --pgo Build with Profile-Guided Optimization. This flag echo. overrides -c and -d echo. --test-marker Enable the test marker within the build. +echo. --regen Regenerate all opcodes, grammar and tokens echo. echo.Available flags to avoid building certain modules. echo.These flags have no effect if '-e' is not given: @@ -76,7 +77,8 @@ 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 if "%~1"=="--test-marker" (set UseTestMarker=true) & shift & goto CheckOpts -if "%~1"=="-V" shift & goto :Version +if "%~1"=="-V" shift & goto Version +if "%~1"=="--regen" (set Regen=true) & shift & goto CheckOpts rem These use the actual property names used by MSBuild. We could just let rem them in through the environment, but we specify them on the command line rem anyway for visibility so set defaults after this @@ -154,9 +156,22 @@ echo on /p:UseTestMarker=%UseTestMarker% %GITProperty%^ %1 %2 %3 %4 %5 %6 %7 %8 %9 +if "%Regen%"=="true" call :Regen @echo off exit /b %ERRORLEVEL% +:Regen +echo on +call "%dir%find_msbuild.bat" %MSBUILD% +if not ERRORLEVEL 1 %MSBUILD% "%dir%regen.vcxproj" /t:%target% %parallel% %verbose%^ + /p:IncludeExternals=%IncludeExternals%^ + /p:Configuration=%conf% /p:Platform=%platf%^ + /p:UseTestMarker=%UseTestMarker% %GITProperty%^ + %1 %2 %3 %4 %5 %6 %7 %8 %9 + +@echo off +goto :eof + :Version rem Display the current build version information call "%dir%find_msbuild.bat" %MSBUILD% diff --git a/PCbuild/regen.vcxproj b/PCbuild/regen.vcxproj new file mode 100644 index 00000000000..876b12bae9c --- /dev/null +++ b/PCbuild/regen.vcxproj @@ -0,0 +1,225 @@ + + + + + Debug + ARM + + + Debug + Win32 + + + Debug + x64 + + + PGInstrument + ARM + + + PGInstrument + Win32 + + + PGInstrument + x64 + + + PGUpdate + ARM + + + PGUpdate + Win32 + + + PGUpdate + x64 + + + Release + ARM + + + Release + Win32 + + + Release + x64 + + + + {21CF2108-2CC9-4005-A6ED-B7965ADE3854} + Win32Proj + regen + false + 10.0 + + + + + Utility + Unicode + + + v142 + + + v142 + + + v142 + + + v142 + + + v142 + + + v142 + + + v142 + + + v142 + + + v142 + + + v142 + + + v142 + + + v142 + + + + + + + + + + + + _CONSOLE;%(PreprocessorDefinitions) + + + Console + + + + + + + + {cf7ac3d1-e2df-41d2-bea6-1e2556cdea26} + true + true + false + true + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file