Commit f41b48ef authored by Jake Petroules's avatar Jake Petroules

Rename Abi::MacOS/GenericMacFlavor to DarwinOS/GenericDarwinFlavor

This makes clear that the ABI encompasses all Darwin platforms (macOS,
iOS, tvOS, watchOS) in the wake of the OS X to macOS rename, and would
have been more technically correct anyways since ABIs are far below the
"macOS" parts of our favorite desktop Unix operating system.

Change-Id: I16d1477f44ffe70e5d8cddd67199a1602ba6fd97
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 8393b35a
......@@ -353,7 +353,7 @@ static DebuggerItem::MatchLevel matchSingle(const Abi &debuggerAbi, const Abi &t
return DebuggerItem::MatchesPerfectly;
if (HostOsInfo::isLinuxHost() && engineType == GdbEngineType && targetAbi.os() == Abi::LinuxOS)
return DebuggerItem::MatchesPerfectly;
if (HostOsInfo::isMacHost() && engineType == LldbEngineType && targetAbi.os() == Abi::MacOS)
if (HostOsInfo::isMacHost() && engineType == LldbEngineType && targetAbi.os() == Abi::DarwinOS)
return DebuggerItem::MatchesPerfectly;
return DebuggerItem::MatchesWell;
......
......@@ -1993,8 +1993,8 @@ bool GdbEngine::hasCapability(unsigned cap) const
if (runParameters().startMode == AttachCore)
return false;
// FIXME: Remove in case we have gdb 7.x on Mac.
if (runParameters().toolChainAbi.os() == Abi::MacOS)
// FIXME: Remove in case we have gdb 7.x on macOS.
if (runParameters().toolChainAbi.os() == Abi::DarwinOS)
return false;
return cap == SnapshotCapability;
......
......@@ -86,7 +86,7 @@ QList<Abi> IosQtVersion::detectQtAbis() const
for (int i = 0; i < abis.count(); ++i) {
abis[i] = Abi(abis.at(i).architecture(),
abis.at(i).os(),
Abi::GenericMacFlavor,
Abi::GenericDarwinFlavor,
abis.at(i).binaryFormat(),
abis.at(i).wordWidth());
}
......
......@@ -87,17 +87,17 @@ static quint32 getBEUint16(const QByteArray &ba, int pos)
static Abi macAbiForCpu(quint32 type) {
switch (type) {
case 7: // CPU_TYPE_X86, CPU_TYPE_I386
return Abi(Abi::X86Architecture, Abi::MacOS, Abi::GenericMacFlavor, Abi::MachOFormat, 32);
return Abi(Abi::X86Architecture, Abi::DarwinOS, Abi::GenericDarwinFlavor, Abi::MachOFormat, 32);
case 0x01000000 + 7: // CPU_TYPE_X86_64
return Abi(Abi::X86Architecture, Abi::MacOS, Abi::GenericMacFlavor, Abi::MachOFormat, 64);
return Abi(Abi::X86Architecture, Abi::DarwinOS, Abi::GenericDarwinFlavor, Abi::MachOFormat, 64);
case 18: // CPU_TYPE_POWERPC
return Abi(Abi::PowerPCArchitecture, Abi::MacOS, Abi::GenericMacFlavor, Abi::MachOFormat, 32);
return Abi(Abi::PowerPCArchitecture, Abi::DarwinOS, Abi::GenericDarwinFlavor, Abi::MachOFormat, 32);
case 0x01000000 + 18: // CPU_TYPE_POWERPC64
return Abi(Abi::PowerPCArchitecture, Abi::MacOS, Abi::GenericMacFlavor, Abi::MachOFormat, 32);
return Abi(Abi::PowerPCArchitecture, Abi::DarwinOS, Abi::GenericDarwinFlavor, Abi::MachOFormat, 32);
case 12: // CPU_TYPE_ARM
return Abi(Abi::ArmArchitecture, Abi::MacOS, Abi::GenericMacFlavor, Abi::MachOFormat, 32);
return Abi(Abi::ArmArchitecture, Abi::DarwinOS, Abi::GenericDarwinFlavor, Abi::MachOFormat, 32);
case 0x01000000 + 12: // CPU_TYPE_ARM64
return Abi(Abi::ArmArchitecture, Abi::MacOS, Abi::GenericMacFlavor, Abi::MachOFormat, 64);
return Abi(Abi::ArmArchitecture, Abi::DarwinOS, Abi::GenericDarwinFlavor, Abi::MachOFormat, 64);
default:
return Abi();
}
......@@ -327,8 +327,8 @@ Abi::Abi(const Architecture &a, const OS &o,
if (m_osFlavor < FreeBsdFlavor || m_osFlavor > OpenBsdFlavor)
m_osFlavor = UnknownFlavor;
break;
case Abi::MacOS:
if (m_osFlavor < GenericMacFlavor || m_osFlavor > GenericMacFlavor)
case Abi::DarwinOS:
if (m_osFlavor < GenericDarwinFlavor || m_osFlavor > GenericDarwinFlavor)
m_osFlavor = UnknownFlavor;
break;
case Abi::UnixOS:
......@@ -378,8 +378,9 @@ Abi::Abi(const QString &abiString) :
m_os = LinuxOS;
else if (abiParts.at(1) == QLatin1String("bsd"))
m_os = BsdOS;
else if (abiParts.at(1) == QLatin1String("macos"))
m_os = MacOS;
else if (abiParts.at(1) == QLatin1String("darwin")
|| abiParts.at(1) == QLatin1String("macos"))
m_os = DarwinOS;
else if (abiParts.at(1) == QLatin1String("unix"))
m_os = UnixOS;
else if (abiParts.at(1) == QLatin1String("windows"))
......@@ -403,8 +404,8 @@ Abi::Abi(const QString &abiString) :
m_osFlavor = NetBsdFlavor;
else if (abiParts.at(2) == QLatin1String("openbsd") && m_os == BsdOS)
m_osFlavor = OpenBsdFlavor;
else if (abiParts.at(2) == QLatin1String("generic") && m_os == MacOS)
m_osFlavor = GenericMacFlavor;
else if (abiParts.at(2) == QLatin1String("generic") && m_os == DarwinOS)
m_osFlavor = GenericDarwinFlavor;
else if (abiParts.at(2) == QLatin1String("generic") && m_os == UnixOS)
m_osFlavor = GenericUnixFlavor;
else if (abiParts.at(2) == QLatin1String("solaris") && m_os == UnixOS)
......@@ -531,8 +532,8 @@ Abi Abi::abiFromTargetTriplet(const QString &triple)
flavor = Abi::WindowsMSysFlavor;
format = Abi::PEFormat;
} else if (p == QLatin1String("apple")) {
os = Abi::MacOS;
flavor = Abi::GenericMacFlavor;
os = Abi::DarwinOS;
flavor = Abi::GenericDarwinFlavor;
format = Abi::MachOFormat;
} else if (p == QLatin1String("darwin10")) {
width = 64;
......@@ -649,8 +650,8 @@ QString Abi::toString(const OS &o)
return QLatin1String("linux");
case BsdOS:
return QLatin1String("bsd");
case MacOS:
return QLatin1String("macos");
case DarwinOS:
return QLatin1String("darwin");
case UnixOS:
return QLatin1String("unix");
case WindowsOS:
......@@ -676,7 +677,7 @@ QString Abi::toString(const OSFlavor &of)
return QLatin1String("netbsd");
case Abi::OpenBsdFlavor:
return QLatin1String("openbsd");
case Abi::GenericMacFlavor:
case Abi::GenericDarwinFlavor:
return QLatin1String("generic");
case Abi::GenericUnixFlavor:
return QLatin1String("generic");
......@@ -738,8 +739,8 @@ QList<Abi::OSFlavor> Abi::flavorsForOs(const Abi::OS &o)
return result << FreeBsdFlavor << OpenBsdFlavor << NetBsdFlavor << UnknownFlavor;
case LinuxOS:
return result << GenericLinuxFlavor << AndroidLinuxFlavor << UnknownFlavor;
case MacOS:
return result << GenericMacFlavor << UnknownFlavor;
case DarwinOS:
return result << GenericDarwinFlavor << UnknownFlavor;
case UnixOS:
return result << GenericUnixFlavor << SolarisUnixFlavor << UnknownFlavor;
case WindowsOS:
......@@ -785,9 +786,9 @@ Abi Abi::hostAbi()
os = LinuxOS;
subos = GenericLinuxFlavor;
format = ElfFormat;
#elif defined (Q_OS_MAC)
os = MacOS;
subos = GenericMacFlavor;
#elif defined (Q_OS_DARWIN)
os = DarwinOS;
subos = GenericDarwinFlavor;
format = MachOFormat;
#elif defined (Q_OS_BSD4)
os = BsdOS;
......@@ -923,7 +924,7 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data()
<< (QStringList() << QString::fromLatin1("x86-windows-unknown-pe-32bit"));
QTest::newRow("static QtCore: mac (debug)")
<< QString::fromLatin1("%1/static/mac-32bit-debug.a").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-macos-generic-mach_o-32bit"));
<< (QStringList() << QString::fromLatin1("x86-darwin-generic-mach_o-32bit"));
QTest::newRow("static QtCore: linux 32bit")
<< QString::fromLatin1("%1/static/linux-32bit-release.a").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-linux-generic-elf-32bit"));
......@@ -933,9 +934,9 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data()
QTest::newRow("static stdc++: mac fat")
<< QString::fromLatin1("%1/static/mac-fat.a").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-macos-generic-mach_o-32bit")
<< QString::fromLatin1("ppc-macos-generic-mach_o-32bit")
<< QString::fromLatin1("x86-macos-generic-mach_o-64bit"));
<< (QStringList() << QString::fromLatin1("x86-darwin-generic-mach_o-32bit")
<< QString::fromLatin1("ppc-darwin-generic-mach_o-32bit")
<< QString::fromLatin1("x86-darwin-generic-mach_o-64bit"));
QTest::newRow("executable: win msvc2013 64bit")
<< QString::fromLatin1("%1/executables/x86-windows-mvsc2013-pe-64bit.exe").arg(prefix)
......@@ -973,9 +974,9 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary_data()
QTest::newRow("dynamic stdc++: mac fat")
<< QString::fromLatin1("%1/dynamic/mac-fat.dylib").arg(prefix)
<< (QStringList() << QString::fromLatin1("x86-macos-generic-mach_o-32bit")
<< QString::fromLatin1("ppc-macos-generic-mach_o-32bit")
<< QString::fromLatin1("x86-macos-generic-mach_o-64bit"));
<< (QStringList() << QString::fromLatin1("x86-darwin-generic-mach_o-32bit")
<< QString::fromLatin1("ppc-darwin-generic-mach_o-32bit")
<< QString::fromLatin1("x86-darwin-generic-mach_o-64bit"));
QTest::newRow("dynamic QtCore: arm linux 32bit")
<< QString::fromLatin1("%1/dynamic/arm-linux.so").arg(prefix)
<< (QStringList() << QString::fromLatin1("arm-linux-generic-elf-32bit"));
......@@ -1051,11 +1052,11 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiFromTargetTriplet_data()
QTest::addColumn<int>("wordWidth");
QTest::newRow("x86_64-apple-darwin") << int(Abi::X86Architecture)
<< int(Abi::MacOS) << int(Abi::GenericMacFlavor)
<< int(Abi::DarwinOS) << int(Abi::GenericDarwinFlavor)
<< int(Abi::MachOFormat) << 64;
QTest::newRow("x86_64-apple-darwin12.5.0") << int(Abi::X86Architecture)
<< int(Abi::MacOS) << int(Abi::GenericMacFlavor)
<< int(Abi::DarwinOS) << int(Abi::GenericDarwinFlavor)
<< int(Abi::MachOFormat) << 64;
QTest::newRow("x86_64-linux-gnu") << int(Abi::X86Architecture)
......
......@@ -54,7 +54,7 @@ public:
enum OS {
BsdOS,
LinuxOS,
MacOS,
DarwinOS,
UnixOS,
WindowsOS,
VxWorks,
......@@ -71,8 +71,8 @@ public:
GenericLinuxFlavor,
AndroidLinuxFlavor,
// Mac
GenericMacFlavor,
// Darwin
GenericDarwinFlavor,
// Unix
GenericUnixFlavor,
......
......@@ -177,7 +177,7 @@ static QList<Abi> guessGccAbi(const QString &m, const QByteArray &macros)
else if (macros.contains("#define __SIZEOF_SIZE_T__ 4"))
width = 32;
if (os == Abi::MacOS) {
if (os == Abi::DarwinOS) {
// Apple does PPC and x86!
abiList << Abi(arch, os, flavor, format, width);
abiList << Abi(arch, os, flavor, format, width == 64 ? 32 : 64);
......@@ -575,9 +575,9 @@ FileNameList GccToolChain::suggestedMkspecList() const
|| abi.osFlavor() != host.osFlavor()) // Note: This can fail:-(
return FileNameList();
if (abi.os() == Abi::MacOS) {
if (abi.os() == Abi::DarwinOS) {
QString v = version();
// prefer versioned g++ on mac. This is required to enable building for older Mac OS versions
// prefer versioned g++ on macOS. This is required to enable building for older macOS versions
if (v.startsWith(QLatin1String("4.0")) && m_compilerCommand.endsWith(QLatin1String("-4.0")))
return FileNameList() << FileName::fromLatin1("macx-g++40");
if (v.startsWith(QLatin1String("4.2")) && m_compilerCommand.endsWith(QLatin1String("-4.2")))
......@@ -1104,7 +1104,7 @@ WarningFlags ClangToolChain::warningFlags(const QStringList &cflags) const
FileNameList ClangToolChain::suggestedMkspecList() const
{
Abi abi = targetAbi();
if (abi.os() == Abi::MacOS)
if (abi.os() == Abi::DarwinOS)
return FileNameList()
<< FileName::fromLatin1("macx-clang")
<< FileName::fromLatin1("macx-clang-32")
......@@ -1508,23 +1508,23 @@ void ProjectExplorerPlugin::testGccAbiGuessing_data()
QTest::newRow("Mac 1")
<< QString::fromLatin1("i686-apple-darwin10")
<< QByteArray("#define __SIZEOF_SIZE_T__ 8\n")
<< (QStringList() << QLatin1String("x86-macos-generic-mach_o-64bit")
<< QLatin1String("x86-macos-generic-mach_o-32bit"));
<< (QStringList() << QLatin1String("x86-darwin-generic-mach_o-64bit")
<< QLatin1String("x86-darwin-generic-mach_o-32bit"));
QTest::newRow("Mac 2")
<< QString::fromLatin1("powerpc-apple-darwin10")
<< QByteArray("#define __SIZEOF_SIZE_T__ 8\n")
<< (QStringList() << QLatin1String("ppc-macos-generic-mach_o-64bit")
<< QLatin1String("ppc-macos-generic-mach_o-32bit"));
<< (QStringList() << QLatin1String("ppc-darwin-generic-mach_o-64bit")
<< QLatin1String("ppc-darwin-generic-mach_o-32bit"));
QTest::newRow("Mac 3")
<< QString::fromLatin1("i686-apple-darwin9")
<< QByteArray("#define __SIZEOF_SIZE_T__ 4\n")
<< (QStringList() << QLatin1String("x86-macos-generic-mach_o-32bit")
<< QLatin1String("x86-macos-generic-mach_o-64bit"));
<< (QStringList() << QLatin1String("x86-darwin-generic-mach_o-32bit")
<< QLatin1String("x86-darwin-generic-mach_o-64bit"));
QTest::newRow("Mac IOS")
<< QString::fromLatin1("arm-apple-darwin9")
<< QByteArray("#define __SIZEOF_SIZE_T__ 4\n")
<< (QStringList() << QLatin1String("arm-macos-generic-mach_o-32bit")
<< QLatin1String("arm-macos-generic-mach_o-64bit"));
<< (QStringList() << QLatin1String("arm-darwin-generic-mach_o-32bit")
<< QLatin1String("arm-darwin-generic-mach_o-64bit"));
QTest::newRow("Intel 1")
<< QString::fromLatin1("86_64 x86_64 GNU/Linux")
<< QByteArray("#define __SIZEOF_SIZE_T__ 8\n")
......
......@@ -88,7 +88,7 @@ static QStringList targetOSList(const ProjectExplorer::Abi &abi, const ProjectEx
}
os << QLatin1String("windows");
break;
case ProjectExplorer::Abi::MacOS:
case ProjectExplorer::Abi::DarwinOS:
if (device == DESKTOP_DEVICE_TYPE)
os << QLatin1String("macos") << QLatin1String("osx");
else if (device == IOS_DEVICE_TYPE)
......@@ -196,7 +196,7 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor
break;
}
} else if (targetAbi.architecture() == ProjectExplorer::Abi::ArmArchitecture &&
targetAbi.os() == ProjectExplorer::Abi::MacOS) {
targetAbi.os() == ProjectExplorer::Abi::DarwinOS) {
architecture.append(QLatin1String("v7"));
}
......@@ -211,7 +211,7 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor
if (!toolchain.isEmpty())
data.insert(QLatin1String(QBS_TOOLCHAIN), toolchain);
if (targetAbi.os() == ProjectExplorer::Abi::MacOS) {
if (targetAbi.os() == ProjectExplorer::Abi::DarwinOS) {
// Set Xcode SDK name and version - required by Qbs if a sysroot is present
// Ideally this would be done in a better way...
const QRegExp sdkNameRe(QLatin1String("(macosx|iphoneos|iphonesimulator)([0-9]+\\.[0-9]+)"));
......
......@@ -78,7 +78,7 @@ LibraryDetailsController::LibraryDetailsController(
case Abi::WindowsOS:
m_creatorPlatform = CreatorWindows;
break;
case Abi::MacOS:
case Abi::DarwinOS:
m_creatorPlatform = CreatorMac;
break;
default:
......
......@@ -258,7 +258,7 @@ bool MakeStep::init(QList<const BuildStep *> &earlierSteps)
pp->resolveAll();
setOutputParser(new ProjectExplorer::GnuMakeParser());
if (tc && tc->targetAbi().os() == Abi::MacOS)
if (tc && tc->targetAbi().os() == Abi::DarwinOS)
appendOutputParser(new XcodebuildParser);
IOutputParser *parser = target()->kit()->createOutputParser();
if (parser)
......
......@@ -1464,7 +1464,7 @@ void QmakeProject::collectLibraryData(const QmakeProFileNode *node, DeploymentDa
deploymentData.addFile(destDirFor(ti) + QLatin1Char('/') + targetFileName, targetPath);
break;
}
case Abi::MacOS: {
case Abi::DarwinOS: {
QString destDir = destDirFor(ti);
if (config.contains(QLatin1String("lib_bundle"))) {
destDir.append(QLatin1Char('/')).append(ti.target)
......@@ -1543,7 +1543,7 @@ QString QmakeProject::executableFor(const QmakeProFileNode *node)
QString target;
switch (toolchain->targetAbi().os()) {
case Abi::MacOS:
case Abi::DarwinOS:
if (node->variableValue(ConfigVar).contains(QLatin1String("app_bundle"))) {
target = ti.target + QLatin1String(".app/Contents/MacOS/") + ti.target;
break;
......
......@@ -145,7 +145,7 @@ QList<BuildInfo *> QmakeProjectImporter::import(const FileName &importPath, bool
QList<ProjectExplorer::Abi> abis = version->qtAbis();
if (!abis.isEmpty()) {
ProjectExplorer::Abi abi = abis.first();
if (abi.os() == ProjectExplorer::Abi::MacOS) {
if (abi.os() == ProjectExplorer::Abi::DarwinOS) {
if (abi.wordWidth() == 64)
archConfig = QMakeStepConfig::X86_64;
else
......
......@@ -879,7 +879,7 @@ QMakeStepConfig::TargetArchConfig QMakeStepConfig::targetArchFor(const Abi &targ
QMakeStepConfig::TargetArchConfig arch = QMakeStepConfig::NoArch;
if (!version || version->type() != QLatin1String(QtSupport::Constants::DESKTOPQT))
return arch;
if ((targetAbi.os() == ProjectExplorer::Abi::MacOS)
if ((targetAbi.os() == ProjectExplorer::Abi::DarwinOS)
&& (targetAbi.binaryFormat() == ProjectExplorer::Abi::MachOFormat)) {
if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture) {
if (targetAbi.wordWidth() == 32)
......@@ -902,7 +902,7 @@ QMakeStepConfig::OsType QMakeStepConfig::osTypeFor(const ProjectExplorer::Abi &t
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios";
if (!version || version->type() != QLatin1String(IOSQT))
return os;
if ((targetAbi.os() == ProjectExplorer::Abi::MacOS)
if ((targetAbi.os() == ProjectExplorer::Abi::DarwinOS)
&& (targetAbi.binaryFormat() == ProjectExplorer::Abi::MachOFormat)) {
if (targetAbi.architecture() == ProjectExplorer::Abi::X86Architecture) {
os = QMakeStepConfig::IphoneSimulator;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment