diff options
author | Steve Dower <steve.dower@python.org> | 2023-01-27 14:45:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-27 14:45:08 (GMT) |
commit | 737d367b1f4bad76914173a64d6bbe19a984cd5f (patch) | |
tree | fc15b2c1c3dad1d49acd95304a0b1a85a1862388 /PCbuild | |
parent | 7956e0c30001cc0940caa66fab4d72455c865b3a (diff) | |
download | cpython-737d367b1f4bad76914173a64d6bbe19a984cd5f.zip cpython-737d367b1f4bad76914173a64d6bbe19a984cd5f.tar.gz cpython-737d367b1f4bad76914173a64d6bbe19a984cd5f.tar.bz2 |
gh-77532: Minor tweaks to allow compiling with PlatformToolset=ClangCL on Windows (GH-101352)
To use this, ensure that clang support was selected in Visual Studio Installer, then set the PlatformToolset environment variable to "ClangCL" and build as normal from the command line.
It remains unsupported, but at least is possible now for experimentation.
Diffstat (limited to 'PCbuild')
-rw-r--r-- | PCbuild/pyproject.props | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index e398b33..92c7849 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -25,7 +25,8 @@ <_DebugPreprocessorDefinition>NDEBUG;</_DebugPreprocessorDefinition> <_DebugPreprocessorDefinition Condition="$(Configuration) == 'Debug'">_DEBUG;</_DebugPreprocessorDefinition> <_PlatformPreprocessorDefinition>_WIN32;</_PlatformPreprocessorDefinition> - <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64;_M_X64;</_PlatformPreprocessorDefinition> + <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64'">_WIN64;</_PlatformPreprocessorDefinition> + <_PlatformPreprocessorDefinition Condition="$(Platform) == 'x64' and $(PlatformToolset) != 'ClangCL'">_M_X64;$(_PlatformPreprocessorDefinition)</_PlatformPreprocessorDefinition> <_Py3NamePreprocessorDefinition>PY3_DLLNAME=L"$(Py3DllName)";</_Py3NamePreprocessorDefinition> </PropertyGroup> <ItemDefinitionGroup> @@ -45,8 +46,10 @@ <SuppressStartupBanner>true</SuppressStartupBanner> <WholeProgramOptimization>true</WholeProgramOptimization> <ControlFlowGuard Condition="$(EnableControlFlowGuard) != ''">$(EnableControlFlowGuard)</ControlFlowGuard> - <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions> <MultiProcessorCompilation>true</MultiProcessorCompilation> + <AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions Condition="$(PlatformToolset) == 'ClangCL'">-Wno-deprecated-non-prototype -Wno-unused-label -Wno-pointer-sign -Wno-incompatible-pointer-types-discards-qualifiers -Wno-unused-function %(AdditionalOptions)</AdditionalOptions> + <AdditionalOptions Condition="$(Configuration) != 'Debug' and $(PlatformToolset) == 'ClangCL'">-flto %(AdditionalOptions)</AdditionalOptions> </ClCompile> <ClCompile Condition="$(Configuration) == 'Debug'"> <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> |