diff --git a/Misc/NEWS.d/next/Build/2025-03-15-12-32-56.gh-issue-131278.1nd0mJ.rst b/Misc/NEWS.d/next/Build/2025-03-15-12-32-56.gh-issue-131278.1nd0mJ.rst new file mode 100644 index 00000000000000..56e698383aa1ef --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-03-15-12-32-56.gh-issue-131278.1nd0mJ.rst @@ -0,0 +1,2 @@ +Add optimizing flag ``WITH_COMPUTED_GOTOS`` to Windows builds for when +using a compiler that supports it (currently clang-cl). Patch by Chris Eibl. diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index cef0e81e11972c..045d109d2820a1 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -107,6 +107,7 @@ _Py_JIT;%(PreprocessorDefinitions) _Py_TIER2=$(UseTIER2);%(PreprocessorDefinitions) Py_TAIL_CALL_INTERP=1;%(PreprocessorDefinitions) + HAVE_COMPUTED_GOTOS;%(PreprocessorDefinitions) version.lib;ws2_32.lib;pathcch.lib;bcrypt.lib;%(AdditionalDependencies) diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index 33952d31681cbc..8e82d4ea840fe1 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -310,6 +310,27 @@ See for more on this topic. +Optimization flags +------------------ + +You can set optimization flags either via + +* environment variables, for example: + + set WITH_COMPUTED_GOTOS=true + +* or pass them as parameters to `build.bat`, for example: + + build.bat "/p:WITH_COMPUTED_GOTOS=true" + +* or put them in `msbuild.rsp` in the `PCbuild` directory, one flag per line. + +Supported flags are: + +* WITH_COMPUTED_GOTOS: build the interpreter using "computed gotos". + Currently only supported by clang-cl. + + Static library --------------