diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2018-11-30 11:10:02 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-12-02 09:34:58 +0000 |
commit | 383f0b9fcc6f2e6faad002d01560a81df0ca1813 (patch) | |
tree | 74a6fdf20a37c855b237295f6e73859fe9ff34f9 | |
parent | bba377f675d71e4a259bdf374da1cf659eda1ddc (diff) |
Qmake: Use target-specific extension for deployment
Add file extensions to execatables about to be deployed based on the
OS found in the toolchain's targetAbi instead of using the hostOs().
This should fix deployment from windows to non-windows machines.
Task-number: QTCREATORBUG-21608
Change-Id: I83678bda1d56ff24848b7b498b95081d00b5a5f0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
-rw-r--r-- | src/plugins/projectexplorer/abi.cpp | 21 | ||||
-rw-r--r-- | src/plugins/projectexplorer/abi.h | 4 | ||||
-rw-r--r-- | src/plugins/qmakeprojectmanager/qmakeproject.cpp | 2 |
3 files changed, 26 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index bc8c9efa4e..69d87fd1b0 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -547,6 +547,27 @@ Abi Abi::abiFromTargetTriplet(const QString &triple) return Abi(arch, os, flavor, format, width); } +Utils::OsType Abi::abiOsToOsType(const Abi::OS os) +{ + switch (os) { + case ProjectExplorer::Abi::LinuxOS: + return Utils::OsType::OsTypeLinux; + case ProjectExplorer::Abi::DarwinOS: + return Utils::OsType::OsTypeMac; + case ProjectExplorer::Abi::BsdOS: + case ProjectExplorer::Abi::UnixOS: + return Utils::OsType::OsTypeOtherUnix; + case ProjectExplorer::Abi::WindowsOS: + return Utils::OsType::OsTypeWindows; + case ProjectExplorer::Abi::VxWorks: + case ProjectExplorer::Abi::QnxOS: + case ProjectExplorer::Abi::BareMetalOS: + case ProjectExplorer::Abi::UnknownOS: + return Utils::OsType::OsTypeOther; + } + return Utils::OsType::OsTypeOther; +} + QString Abi::toString() const { const QStringList dn = {toString(m_architecture), toString(m_os), toString(m_osFlavor), diff --git a/src/plugins/projectexplorer/abi.h b/src/plugins/projectexplorer/abi.h index 09cc284a5c..e49df3348f 100644 --- a/src/plugins/projectexplorer/abi.h +++ b/src/plugins/projectexplorer/abi.h @@ -27,6 +27,8 @@ #include "projectexplorer_export.h" +#include <utils/osspecificaspects.h> + #include <QList> #include <QHash> @@ -112,6 +114,8 @@ public: static Abi abiFromTargetTriplet(const QString &machineTriple); + static Utils::OsType abiOsToOsType(const OS os); + bool operator != (const Abi &other) const; bool operator == (const Abi &other) const; bool isCompatibleWith(const Abi &other) const; diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 8989c4ecee..8c2ded5acd 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -1348,7 +1348,7 @@ QString QmakeProject::executableFor(const QmakeProFileNode *node) } else { const QString extension = file->singleVariableValue(Variable::TargetExt); if (extension.isEmpty()) - target = HostOsInfo::withExecutableSuffix(ti.target); + target = OsSpecificAspects::withExecutableSuffix(Abi::abiOsToOsType(tc->targetAbi().os()), ti.target); else target = ti.target + extension; } |