macOS: Fix configuration issues with CMake 4 and later

CMake 4 significantly changed its behavior with regards to setting up the
CMAKE_OSX_SYSROOT - it doesn't set it anymore, assuming that the
compiler will be from the command line tools /usr/bin/clang(++) which
set the sysroot to the latest macOS themselves. For details see
https://github.com/Kitware/CMake/commit/7b195312919cbf69

So it turns out that the choice for unification of the chosen compiler to
the Xcode.app ones (as detected from the iOS plugin) in
f49f9b43da bites back now.

On the contrary, deprioritize the Xcode.app compilers, so the /usr/bin
ones are used for Desktop kits. The auto-generated iOS kits keep
choosing the Xcode.app compilers and set their sysroot explicitly
already.

Fixes: QTCREATORBUG-32877
Change-Id: Ia8a4aab009d4d959743a27091217ea9b80811da0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Eike Ziller
2025-04-30 08:43:49 +02:00
parent 2234af0e61
commit fc5d289e79

View File

@@ -624,7 +624,7 @@ Toolchains IosToolchainFactory::autoDetect(const ToolchainDetector &detector) co
if (!toolChain) { if (!toolChain) {
toolChain = new GccToolchain(ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID, toolChain = new GccToolchain(ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID,
GccToolchain::Clang); GccToolchain::Clang);
toolChain->setPriority(Toolchain::PriorityHigh); toolChain->setPriority(Toolchain::PriorityLow);
toolChain->setDetection(Toolchain::AutoDetection); toolChain->setDetection(Toolchain::AutoDetection);
toolChain->setLanguage(l); toolChain->setLanguage(l);
toolChain->setDisplayName(target.name); toolChain->setDisplayName(target.name);