summaryrefslogtreecommitdiff
path: root/src/plugins/qnx
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-11-14 10:43:57 +0100
committerTobias Hunger <tobias.hunger@qt.io>2019-11-14 12:02:41 +0000
commit6e518e6b177954af4883b4d51c73ad1f4af29f68 (patch)
treeddbf29b76937964e3cb0d732bf4f32317dca3b96 /src/plugins/qnx
parentecf01052875ba8da226058e50bda63a7302fd62b (diff)
downloadqt-creator-6e518e6b177954af4883b4d51c73ad1f4af29f68.tar.gz
Qnx: Do not read CPU dir from mkspec
Generate it based on the detected ABI instead. Change-Id: I979d02a8d97bd54575095eaa5100d3572d0ced2c Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/qnx')
-rw-r--r--src/plugins/qnx/qnxqtversion.cpp12
-rw-r--r--src/plugins/qnx/qnxqtversion.h3
-rw-r--r--src/plugins/qnx/qnxutils.cpp11
-rw-r--r--src/plugins/qnx/qnxutils.h1
4 files changed, 16 insertions, 11 deletions
diff --git a/src/plugins/qnx/qnxqtversion.cpp b/src/plugins/qnx/qnxqtversion.cpp
index 3c704bb421..1f134feb15 100644
--- a/src/plugins/qnx/qnxqtversion.cpp
+++ b/src/plugins/qnx/qnxqtversion.cpp
@@ -95,14 +95,10 @@ Utils::FilePath QnxQtVersion::qnxTarget() const
QString QnxQtVersion::cpuDir() const
{
- ensureMkSpecParsed();
- return m_cpuDir;
-}
-
-void QnxQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const
-{
- m_cpuDir = evaluator->value(QLatin1String("QNX_CPUDIR"));
- BaseQtVersion::parseMkSpec(evaluator);
+ const Abis abis = qtAbis();
+ if (abis.empty())
+ return QString();
+ return QnxUtils::cpuDirFromAbi(abis.at(0));
}
QVariantMap QnxQtVersion::toMap() const
diff --git a/src/plugins/qnx/qnxqtversion.h b/src/plugins/qnx/qnxqtversion.h
index d41e19852c..c12da8b566 100644
--- a/src/plugins/qnx/qnxqtversion.h
+++ b/src/plugins/qnx/qnxqtversion.h
@@ -67,9 +67,6 @@ public:
QString sdpPath() const;
void setSdpPath(const QString &sdpPath);
-protected:
- void parseMkSpec(ProFileEvaluator *) const override;
-
private:
void updateEnvironment() const;
diff --git a/src/plugins/qnx/qnxutils.cpp b/src/plugins/qnx/qnxutils.cpp
index f45764c4e0..404bcb99bb 100644
--- a/src/plugins/qnx/qnxutils.cpp
+++ b/src/plugins/qnx/qnxutils.cpp
@@ -56,6 +56,17 @@ QString QnxUtils::addQuotes(const QString &string)
return QLatin1Char('"') + string + QLatin1Char('"');
}
+QString QnxUtils::cpuDirFromAbi(const Abi &abi)
+{
+ if (abi.os() != Abi::OS::QnxOS)
+ return QString();
+ if (abi.architecture() == Abi::Architecture::ArmArchitecture)
+ return QString::fromLatin1(abi.wordWidth() == 32 ? "armle-v7" : "aarch64le");
+ if (abi.architecture() == Abi::Architecture::X86Architecture)
+ return QString::fromLatin1(abi.wordWidth() == 32 ? "x86" : "x86_64");
+ return QString();
+}
+
QString QnxUtils::cpuDirShortDescription(const QString &cpuDir)
{
if (cpuDir == "armle-v7")
diff --git a/src/plugins/qnx/qnxutils.h b/src/plugins/qnx/qnxutils.h
index 63ef5dd86e..5ebf1534f2 100644
--- a/src/plugins/qnx/qnxutils.h
+++ b/src/plugins/qnx/qnxutils.h
@@ -69,6 +69,7 @@ class QnxUtils
{
public:
static QString addQuotes(const QString &string);
+ static QString cpuDirFromAbi(const ProjectExplorer::Abi &abi);
static QString cpuDirShortDescription(const QString &cpuDir);
static Utils::EnvironmentItems qnxEnvironmentFromEnvFile(const QString &fileName);
static QString envFilePath(const QString &sdpPath);