]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-131473: Override PreferredToolArchitecture when using Visual Studio bundled clang...
authorChris Eibl <138194463+chris-eibl@users.noreply.github.com>
Mon, 24 Mar 2025 23:15:51 +0000 (00:15 +0100)
committerGitHub <noreply@github.com>
Mon, 24 Mar 2025 23:15:51 +0000 (23:15 +0000)
tweak PreferredToolArchitecture for bundled clang-cl

PCbuild/python.props

index 5a3fae0e2f69feea616ac8726a8037eb8091f882..d1c4b5bda6c3d3040373592e282ffb0dab696940 100644 (file)
     <ICCBuild>false</ICCBuild>
     <ICCBuild Condition="$(PlatformToolset.StartsWith(`Intel C++ Compiler`))">true</ICCBuild>
 
+    <!--
+    This ensures, that in case of clang-cl bundled with VS
+    we find e.g. clang_rt.profile.lib in the correct bitness.
+    In case the user sets LLVMInstallDir and LLVMToolsVersion,
+    they are responsible to use the correct tool architecture.
+    For details please see GH-131473.
+    -->
+    <PreferredToolArchitecture Condition="$(LLVMInstallDir) == '' and $(PlatformToolset) == 'ClangCL' and $(Platform) == 'x64'">x64</PreferredToolArchitecture>
+    <PreferredToolArchitecture Condition="$(LLVMInstallDir) == '' and $(PlatformToolset) == 'ClangCL' and $(Platform) == 'Win32'">x86</PreferredToolArchitecture>
+
     <!--
     Convincing MSVC/MSBuild to prefer our platform names is too difficult,
     so we define our own constant ArchName and use wherever we need it.