forked from qt-creator/qt-creator
Make QNX a separate OS type
Limits conflicts with Linux tool chains and debuggers. Change-Id: Ie6408aecbc2828e8be53c46cf579441ccaba19bb Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -100,7 +100,13 @@ DebuggerItem::DebuggerItem(const QVariantMap &data)
|
|||||||
m_abis.append(abi);
|
m_abis.append(abi);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_version.isEmpty())
|
bool mightBeAPreQnxSeparateOSQnxDebugger = m_command.fileName().startsWith("nto")
|
||||||
|
&& m_abis.count() == 1
|
||||||
|
&& m_abis[0].os() == Abi::UnknownOS
|
||||||
|
&& m_abis[0].osFlavor() == Abi::UnknownFlavor
|
||||||
|
&& m_abis[0].binaryFormat() == Abi::UnknownFormat;
|
||||||
|
|
||||||
|
if (m_version.isEmpty() || mightBeAPreQnxSeparateOSQnxDebugger)
|
||||||
reinitializeFromFile();
|
reinitializeFromFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -347,6 +347,9 @@ Abi::Abi(const Architecture &a, const OS &o,
|
|||||||
case Abi::VxWorks:
|
case Abi::VxWorks:
|
||||||
if (m_osFlavor != VxWorksFlavor)
|
if (m_osFlavor != VxWorksFlavor)
|
||||||
m_osFlavor = VxWorksFlavor;
|
m_osFlavor = VxWorksFlavor;
|
||||||
|
case Abi::QnxOS:
|
||||||
|
if (m_osFlavor != GenericQnxFlavor)
|
||||||
|
m_osFlavor = UnknownFlavor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -392,6 +395,8 @@ Abi::Abi(const QString &abiString) :
|
|||||||
m_os = WindowsOS;
|
m_os = WindowsOS;
|
||||||
else if (abiParts.at(1) == QLatin1String("vxworks"))
|
else if (abiParts.at(1) == QLatin1String("vxworks"))
|
||||||
m_os = VxWorks;
|
m_os = VxWorks;
|
||||||
|
else if (abiParts.at(1) == QLatin1String("qnx"))
|
||||||
|
m_os = QnxOS;
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -403,6 +408,8 @@ Abi::Abi(const QString &abiString) :
|
|||||||
m_osFlavor = GenericLinuxFlavor;
|
m_osFlavor = GenericLinuxFlavor;
|
||||||
else if (abiParts.at(2) == QLatin1String("android") && m_os == LinuxOS)
|
else if (abiParts.at(2) == QLatin1String("android") && m_os == LinuxOS)
|
||||||
m_osFlavor = AndroidLinuxFlavor;
|
m_osFlavor = AndroidLinuxFlavor;
|
||||||
|
else if (abiParts.at(2) == QLatin1String("generic") && m_os == QnxOS)
|
||||||
|
m_osFlavor = GenericQnxFlavor;
|
||||||
else if (abiParts.at(2) == QLatin1String("freebsd") && m_os == BsdOS)
|
else if (abiParts.at(2) == QLatin1String("freebsd") && m_os == BsdOS)
|
||||||
m_osFlavor = FreeBsdFlavor;
|
m_osFlavor = FreeBsdFlavor;
|
||||||
else if (abiParts.at(2) == QLatin1String("netbsd") && m_os == BsdOS)
|
else if (abiParts.at(2) == QLatin1String("netbsd") && m_os == BsdOS)
|
||||||
@@ -556,6 +563,10 @@ Abi Abi::abiFromTargetTriplet(const QString &triple)
|
|||||||
os = Abi::VxWorks;
|
os = Abi::VxWorks;
|
||||||
flavor = Abi::VxWorksFlavor;
|
flavor = Abi::VxWorksFlavor;
|
||||||
format = Abi::ElfFormat;
|
format = Abi::ElfFormat;
|
||||||
|
} else if (p.startsWith(QLatin1String("qnx"))) {
|
||||||
|
os = Abi::QnxOS;
|
||||||
|
flavor = Abi::GenericQnxFlavor;
|
||||||
|
format = Abi::ElfFormat;
|
||||||
} else {
|
} else {
|
||||||
++unknownCount;
|
++unknownCount;
|
||||||
}
|
}
|
||||||
@@ -667,6 +678,8 @@ QString Abi::toString(const OS &o)
|
|||||||
return QLatin1String("windows");
|
return QLatin1String("windows");
|
||||||
case VxWorks:
|
case VxWorks:
|
||||||
return QLatin1String("vxworks");
|
return QLatin1String("vxworks");
|
||||||
|
case QnxOS:
|
||||||
|
return QLatin1String("qnx");
|
||||||
case UnknownOS: // fall through!
|
case UnknownOS: // fall through!
|
||||||
default:
|
default:
|
||||||
return QLatin1String("unknown");
|
return QLatin1String("unknown");
|
||||||
@@ -712,6 +725,8 @@ QString Abi::toString(const OSFlavor &of)
|
|||||||
return QLatin1String("ce");
|
return QLatin1String("ce");
|
||||||
case Abi::VxWorksFlavor:
|
case Abi::VxWorksFlavor:
|
||||||
return QLatin1String("vxworks");
|
return QLatin1String("vxworks");
|
||||||
|
case Abi::GenericQnxFlavor:
|
||||||
|
return QLatin1String("generic");
|
||||||
case Abi::UnknownFlavor: // fall through!
|
case Abi::UnknownFlavor: // fall through!
|
||||||
default:
|
default:
|
||||||
return QLatin1String("unknown");
|
return QLatin1String("unknown");
|
||||||
@@ -761,6 +776,8 @@ QList<Abi::OSFlavor> Abi::flavorsForOs(const Abi::OS &o)
|
|||||||
<< WindowsMSysFlavor << WindowsCEFlavor << UnknownFlavor;
|
<< WindowsMSysFlavor << WindowsCEFlavor << UnknownFlavor;
|
||||||
case VxWorks:
|
case VxWorks:
|
||||||
return result << VxWorksFlavor << UnknownFlavor;
|
return result << VxWorksFlavor << UnknownFlavor;
|
||||||
|
case QnxOS:
|
||||||
|
return result << GenericQnxFlavor << UnknownFlavor;
|
||||||
case UnknownOS:
|
case UnknownOS:
|
||||||
return result << UnknownFlavor;
|
return result << UnknownFlavor;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public:
|
|||||||
UnixOS,
|
UnixOS,
|
||||||
WindowsOS,
|
WindowsOS,
|
||||||
VxWorks,
|
VxWorks,
|
||||||
|
QnxOS,
|
||||||
UnknownOS
|
UnknownOS
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -91,6 +92,9 @@ public:
|
|||||||
|
|
||||||
VxWorksFlavor,
|
VxWorksFlavor,
|
||||||
|
|
||||||
|
// QNX
|
||||||
|
GenericQnxFlavor,
|
||||||
|
|
||||||
UnknownFlavor
|
UnknownFlavor
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ void QnxQtVersion::fromMap(const QVariantMap &map)
|
|||||||
QList<ProjectExplorer::Abi> QnxQtVersion::detectQtAbis() const
|
QList<ProjectExplorer::Abi> QnxQtVersion::detectQtAbis() const
|
||||||
{
|
{
|
||||||
ensureMkSpecParsed();
|
ensureMkSpecParsed();
|
||||||
return qtAbisFromLibrary(qtCorePaths());
|
return QnxUtils::convertAbis(qtAbisFromLibrary(qtCorePaths()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QnxQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const
|
void QnxQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const
|
||||||
|
|||||||
@@ -155,6 +155,11 @@ bool QnxToolChain::fromMap(const QVariantMap &data)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_sdpPath = data.value(QLatin1String(CompilerSdpPath)).toString();
|
m_sdpPath = data.value(QLatin1String(CompilerSdpPath)).toString();
|
||||||
|
|
||||||
|
// Make the ABIs QNX specific (if they aren't already).
|
||||||
|
setSupportedAbis(QnxUtils::convertAbis(supportedAbis()));
|
||||||
|
setTargetAbi(QnxUtils::convertAbi(targetAbi()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
#include "qnxutils.h"
|
#include "qnxutils.h"
|
||||||
#include "qnxqtversion.h"
|
#include "qnxqtversion.h"
|
||||||
|
|
||||||
|
#include <utils/algorithm.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
@@ -251,10 +252,28 @@ QList<QnxTarget> QnxUtils::findTargets(const Utils::FileName &basePath)
|
|||||||
qWarning() << libc << "has more than one ABI ... processing all";
|
qWarning() << libc << "has more than one ABI ... processing all";
|
||||||
|
|
||||||
FileName path = FileName::fromString(iterator.filePath());
|
FileName path = FileName::fromString(iterator.filePath());
|
||||||
for (auto abi : abis)
|
for (Abi abi : abis)
|
||||||
result.append(QnxTarget(path, abi));
|
result.append(QnxTarget(path, QnxUtils::convertAbi(abi)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Abi QnxUtils::convertAbi(const Abi &abi)
|
||||||
|
{
|
||||||
|
if (abi.os() == Abi::LinuxOS && abi.osFlavor() == Abi::GenericLinuxFlavor) {
|
||||||
|
return Abi(abi.architecture(),
|
||||||
|
Abi::QnxOS,
|
||||||
|
Abi::GenericQnxFlavor,
|
||||||
|
abi.binaryFormat(),
|
||||||
|
abi.wordWidth());
|
||||||
|
} else {
|
||||||
|
return abi;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<Abi> QnxUtils::convertAbis(const QList<Abi> &abis)
|
||||||
|
{
|
||||||
|
return Utils::transform(abis, &QnxUtils::convertAbi);
|
||||||
|
}
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ public:
|
|||||||
static QList<ConfigInstallInformation> installedConfigs(const QString &configPath = QString());
|
static QList<ConfigInstallInformation> installedConfigs(const QString &configPath = QString());
|
||||||
static QList<Utils::EnvironmentItem> qnxEnvironment(const QString &sdpPath);
|
static QList<Utils::EnvironmentItem> qnxEnvironment(const QString &sdpPath);
|
||||||
static QList<QnxTarget> findTargets(const Utils::FileName &basePath);
|
static QList<QnxTarget> findTargets(const Utils::FileName &basePath);
|
||||||
|
static ProjectExplorer::Abi convertAbi(const ProjectExplorer::Abi &abi);
|
||||||
|
static QList<ProjectExplorer::Abi> convertAbis(const QList<ProjectExplorer::Abi> &abis);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user