forked from qt-creator/qt-creator
macOS: Remove code handling Qt Creator running under Rosetta
Remove code that was added to handle the case of Qt Creator running as
an Intel binary on ARM Macs, which required some passing of flags to
qmake/CMake/LLDB.
Nowadays, Qt Creator can be built for the corresponding architecture
(and by default we provide universal binaries).
Partially reverts a71d725e46
Change-Id: I842f85b85a26d09cff72199ae86c602fd8f14e33
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
@@ -36,17 +36,6 @@ OsArch HostOsInfo::hostArchitecture()
|
|||||||
return arch;
|
return arch;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HostOsInfo::isRunningUnderRosetta()
|
|
||||||
{
|
|
||||||
#ifdef Q_OS_MACOS
|
|
||||||
int translated = 0;
|
|
||||||
auto size = sizeof(translated);
|
|
||||||
if (sysctlbyname("sysctl.proc_translated", &translated, &size, nullptr, 0) == 0)
|
|
||||||
return translated;
|
|
||||||
#endif
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HostOsInfo::setOverrideFileNameCaseSensitivity(Qt::CaseSensitivity sensitivity)
|
void HostOsInfo::setOverrideFileNameCaseSensitivity(Qt::CaseSensitivity sensitivity)
|
||||||
{
|
{
|
||||||
m_useOverrideFileNameCaseSensitivity = true;
|
m_useOverrideFileNameCaseSensitivity = true;
|
||||||
|
@@ -55,8 +55,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isRunningUnderRosetta();
|
|
||||||
|
|
||||||
static QString withExecutableSuffix(const QString &executable)
|
static QString withExecutableSuffix(const QString &executable)
|
||||||
{
|
{
|
||||||
return OsSpecificAspects::withExecutableSuffix(hostOs(), executable);
|
return OsSpecificAspects::withExecutableSuffix(hostOs(), executable);
|
||||||
|
@@ -1455,20 +1455,11 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
|
|||||||
return QString();
|
return QString();
|
||||||
});
|
});
|
||||||
|
|
||||||
macroExpander()->registerVariable(CMAKE_OSX_ARCHITECTURES_FLAG,
|
macroExpander()->registerVariable(
|
||||||
Tr::tr("The CMake flag for the architecture on macOS"),
|
CMAKE_OSX_ARCHITECTURES_FLAG, Tr::tr("The CMake flag for the architecture on macOS"), [] {
|
||||||
[target] {
|
// TODO deprecated since Qt Creator 15, remove later
|
||||||
if (HostOsInfo::isRunningUnderRosetta()) {
|
return QString();
|
||||||
if (auto *qt = QtSupport::QtKitAspect::qtVersion(target->kit())) {
|
});
|
||||||
const Abis abis = qt->qtAbis();
|
|
||||||
for (const Abi &abi : abis) {
|
|
||||||
if (abi.architecture() == Abi::ArmArchitecture)
|
|
||||||
return QLatin1String("-DCMAKE_OSX_ARCHITECTURES=arm64");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return QLatin1String();
|
|
||||||
});
|
|
||||||
macroExpander()->registerVariable(QT_QML_DEBUG_FLAG,
|
macroExpander()->registerVariable(QT_QML_DEBUG_FLAG,
|
||||||
Tr::tr("The CMake flag for QML debugging, if enabled"),
|
Tr::tr("The CMake flag for QML debugging, if enabled"),
|
||||||
[this] {
|
[this] {
|
||||||
@@ -1568,8 +1559,6 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
|
|||||||
cmd.addArg("%{" + QLatin1String(DEVELOPMENT_TEAM_FLAG) + "}");
|
cmd.addArg("%{" + QLatin1String(DEVELOPMENT_TEAM_FLAG) + "}");
|
||||||
cmd.addArg("%{" + QLatin1String(PROVISIONING_PROFILE_FLAG) + "}");
|
cmd.addArg("%{" + QLatin1String(PROVISIONING_PROFILE_FLAG) + "}");
|
||||||
}
|
}
|
||||||
} else if (device && device->osType() == Utils::OsTypeMac) {
|
|
||||||
cmd.addArg("%{" + QLatin1String(CMAKE_OSX_ARCHITECTURES_FLAG) + "}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isWebAssembly(k) || isQnx(k) || isWindowsARM64(k)) {
|
if (isWebAssembly(k) || isQnx(k) || isWindowsARM64(k)) {
|
||||||
|
@@ -211,10 +211,7 @@ void LldbEngine::setupEngine()
|
|||||||
if (runParameters().debugger.workingDirectory.isDir())
|
if (runParameters().debugger.workingDirectory.isDir())
|
||||||
m_lldbProc.setWorkingDirectory(runParameters().debugger.workingDirectory);
|
m_lldbProc.setWorkingDirectory(runParameters().debugger.workingDirectory);
|
||||||
|
|
||||||
if (HostOsInfo::isRunningUnderRosetta())
|
m_lldbProc.setCommand(CommandLine(lldbCmd));
|
||||||
m_lldbProc.setCommand(CommandLine("/usr/bin/arch", {"-arm64", lldbCmd.toString()}));
|
|
||||||
else
|
|
||||||
m_lldbProc.setCommand(CommandLine(lldbCmd));
|
|
||||||
|
|
||||||
m_lldbProc.start();
|
m_lldbProc.start();
|
||||||
}
|
}
|
||||||
|
@@ -648,12 +648,6 @@ void QMakeStep::updateAbiWidgets()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (qtVersion->hasAbi(Abi::DarwinOS) && !isIos(target()->kit()) && HostOsInfo::isRunningUnderRosetta()) {
|
|
||||||
// Automatically select arm64 when running under Rosetta
|
|
||||||
for (const Abi &abi : abis) {
|
|
||||||
if (abi.architecture() == Abi::ArmArchitecture)
|
|
||||||
selectedAbis.append(abi.param());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user