@echo offgoto Run:Usageecho.%~nx0 [flags and arguments] [quoted MSBuild options]echo.echo.Build CPython from the command line. Requires the appropriateecho.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 passedecho.directly to MSBuild may be passed. If the argument contains an '=', theecho.entire argument must be quoted (e.g. `%~nx0 "/p:PlatformToolset=v100"`).echo.Alternatively you can put extra flags for MSBuild in a file namedecho.`msbuild.rsp` in the `PCbuild` directory, one flag per line. This fileecho.will be picked automatically by MSBuild. Flags put in this file does notecho.need to be quoted. You can still use environment variables inside theecho.response file.echo.echo.Available flags:echo. -h Display this help messageecho. -V Display version information for the current buildecho. -r Target Rebuild instead of Buildecho. -d Set the configuration to Debugecho. -E Don't fetch or build external libraries. Extension modules thatecho. depend on external libraries will not attempt to build if this flagecho. is present; -e is also accepted to explicitly enable fetching andecho. building externals.echo. -m Enable parallel build (enabled by default)echo. -M Disable parallel buildecho. -v Increased output messagesecho. -k Attempt to kill any running Pythons before building (usually doneecho. automatically by the pythoncore project)echo. --pgo Build with Profile-Guided Optimization. This flagecho. overrides -c and -decho. --test-marker Enable the test marker within the build.echo.echo.Available flags to avoid building certain modules.echo.These flags have no effect if '-e' is not given:echo. --no-ssl Do not attempt to build _sslecho. --no-tkinter Do not attempt to build Tkinterecho.echo.Available arguments:echo. -c Release ^| Debug ^| PGInstrument ^| PGUpdateecho. Set the configuration (default: Release)echo. -p x64 ^| Win32echo. Set the platform (default: Win32)echo. -t Build ^| Rebuild ^| Clean ^| CleanAllecho. Set the target manuallyecho. --pgo-job The job to use for PGO training; implies --pgoecho. (default: "-m test --pgo")exit /b 127:Runsetlocalset platf=Win32set conf=Releaseset target=Buildset dir=%~dp0set parallel=/mset verbose=/nologo /v:mset kill=set do_pgo=set pgo_job=-m test --pgo:CheckOptsif "%~1"=="-h" goto Usageif "%~1"=="-c" (set conf=%2) & shift & shift & goto CheckOptsif "%~1"=="-p" (set platf=%2) & shift & shift & goto CheckOptsif "%~1"=="-r" (set target=Rebuild) & shift & goto CheckOptsif "%~1"=="-t" (set target=%2) & shift & shift & goto CheckOptsif "%~1"=="-d" (set conf=Debug) & shift & goto CheckOptsif "%~1"=="-m" (set parallel=/m) & shift & goto CheckOptsif "%~1"=="-M" (set parallel=) & shift & goto CheckOptsif "%~1"=="-v" (set verbose=/v:n) & shift & goto CheckOptsif "%~1"=="-k" (set kill=true) & shift & goto CheckOptsif "%~1"=="--pgo" (set do_pgo=true) & shift & goto CheckOptsif "%~1"=="--pgo-job" (set do_pgo=true) & (set pgo_job=%~2) & shift & shift & goto CheckOptsif "%~1"=="--test-marker" (set UseTestMarker=true) & shift & goto CheckOptsif "%~1"=="-V" shift & goto Versionrem These use the actual property names used by MSBuild. We could just letrem them in through the environment, but we specify them on the command linerem anyway for visibility so set defaults after thisif "%~1"=="-e" (set IncludeExternals=true) & shift & goto CheckOptsif "%~1"=="-E" (set IncludeExternals=false) & shift & goto CheckOptsif "%~1"=="--no-ssl" (set IncludeSSL=false) & shift & goto CheckOptsif "%~1"=="--no-tkinter" (set IncludeTkinter=false) & shift & goto CheckOptsif "%IncludeExternals%"=="" set IncludeExternals=trueif "%IncludeSSL%"=="" set IncludeSSL=trueif "%IncludeTkinter%"=="" set IncludeTkinter=trueif "%IncludeExternals%"=="true" call "%dir%get_externals.bat"if "%do_pgo%" EQU "true" if "%platf%" EQU "x64" (if "%PROCESSOR_ARCHITEW6432%" NEQ "AMD64" if "%PROCESSOR_ARCHITECTURE%" NEQ "AMD64" (echo.ERROR: Cannot cross-compile with PGOecho. 32bit operating system detected. Ensure your PROCESSOR_ARCHITECTUREecho. and PROCESSOR_ARCHITEW6432 environment variables are correct.exit /b 1))if not exist "%GIT%" where git > "%TEMP%\git.loc" 2> nul && set /P GIT= < "%TEMP%\git.loc" & del "%TEMP%\git.loc"if exist "%GIT%" set GITProperty=/p:GIT="%GIT%"if not exist "%GIT%" echo Cannot find Git on PATH & set GITProperty=rem Setup the environmentcall "%dir%find_msbuild.bat" %MSBUILD%if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)if "%kill%"=="true" call :Killif "%do_pgo%"=="true" (set conf=PGInstrumentcall :Build %1 %2 %3 %4 %5 %6 %7 %8 %9del /s "%dir%\*.pgc"del /s "%dir%\..\Lib\*.pyc"echo oncall "%dir%\..\python.bat" %pgo_job%@echo offcall :Killset conf=PGUpdateset target=Build)goto Build:Killecho on%MSBUILD% "%dir%\pythoncore.vcxproj" /t:KillPython %verbose%^/p:Configuration=%conf% /p:Platform=%platf%^/p:KillPython=true@echo offgoto :eof:Buildrem Call on MSBuild to do the work, echo the command.rem Passing %1-9 is not the preferred option, but argument parsing inrem 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:UseTestMarker=%UseTestMarker%%GITProperty%^%1 %2 %3 %4 %5 %6 %7 %8 %9@echo offgoto :eof:Versionrem Display the current build version informationcall "%dir%find_msbuild.bat" %MSBUILD%if not ERRORLEVEL 1 %MSBUILD% "%dir%pythoncore.vcxproj" /t:ShowVersionInfo /v:m /nologo %1 %2 %3 %4 %5 %6 %7 %8 %9
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。