diff options
author | Sam Gross <colesbury@gmail.com> | 2023-09-02 21:13:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-02 21:13:00 (GMT) |
commit | 6fafa6b919227cab06d0e3d7b20120e72d9b2bfd (patch) | |
tree | 0534891b8175f14c63d39674cc1bd860b11f9af6 /PCbuild | |
parent | ecc61a6d76ea329e56f98c4af0f24a17ed3b2d6c (diff) | |
download | cpython-6fafa6b919227cab06d0e3d7b20120e72d9b2bfd.zip cpython-6fafa6b919227cab06d0e3d7b20120e72d9b2bfd.tar.gz cpython-6fafa6b919227cab06d0e3d7b20120e72d9b2bfd.tar.bz2 |
gh-108374: Add --disable-gil option to PCbuild/build.bat (#108729)
This adds a `--disable-gil` option to PCbuild/build.bat. For now, all
this does is define the Py_NOGIL macro.
Diffstat (limited to 'PCbuild')
-rw-r--r-- | PCbuild/build.bat | 3 | ||||
-rw-r--r-- | PCbuild/pyproject.props | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/PCbuild/build.bat b/PCbuild/build.bat index d333cea..e61267b 100644 --- a/PCbuild/build.bat +++ b/PCbuild/build.bat @@ -33,6 +33,7 @@ echo. -k Attempt to kill any running Pythons before building (usually done echo. automatically by the pythoncore project) echo. --pgo Build with Profile-Guided Optimization. This flag echo. overrides -c and -d +echo. --disable-gil Enable experimental support for running without the GIL. echo. --test-marker Enable the test marker within the build. echo. --regen Regenerate all opcodes, grammar and tokens. echo. @@ -80,6 +81,7 @@ if "%~1"=="-q" (set verbose=/v:q /nologo /clp:summary) & 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 +if "%~1"=="--disable-gil" (set UseDisableGil=true) & shift & goto CheckOpts if "%~1"=="--test-marker" (set UseTestMarker=true) & shift & goto CheckOpts if "%~1"=="-V" shift & goto Version if "%~1"=="--regen" (set Regen=true) & shift & goto CheckOpts @@ -172,6 +174,7 @@ echo on /p:IncludeExternals=%IncludeExternals%^ /p:IncludeCTypes=%IncludeCTypes%^ /p:IncludeSSL=%IncludeSSL% /p:IncludeTkinter=%IncludeTkinter%^ + /p:DisableGil=%UseDisableGil%^ /p:UseTestMarker=%UseTestMarker% %GITProperty%^ %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index fd928ca..9db400e 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -40,6 +40,7 @@ <ClCompile> <AdditionalIncludeDirectories>$(PySourcePath)Include;$(PySourcePath)Include\internal;$(PySourcePath)PC;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>WIN32;$(_Py3NamePreprocessorDefinition);$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions> + <PreprocessorDefinitions Condition="'$(DisableGil)' == 'true'">Py_NOGIL=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <Optimization>MaxSpeed</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions> |