aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@nokia.com>2011-09-06 15:19:05 +0000
committerTobias Hunger <tobias.hunger@nokia.com>2011-09-08 18:32:50 +0200
commitaaf260c04b27cc066939de1cc9ad1dafd76ebfa7 (patch)
tree1c708510ccb2f69df72a1f3f345f4eb63e142b1d /src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp
parentbfd9fcbb3ccef3c38b02ee60d949c69bab124090 (diff)
ABI: Improve tool chain selection for Qt projects
* Set a null-ABI for toolchains where detection of ABI failed: This allows the user to select any tool chain. * Warn if ABI detection fails by showing a message in the Qt version setup dialog * Do not override the mkspec if the Qt version has a null ABI only: We (have to) trust the user to know what he is doing in that case. * GCC: Add version information to GCC tool chain and use it to select the mkspec on Mac. * GCC: Do not override mkspec if we do a cross-compile (and actually detect that). * GCC: Leave out -32 or -64 from mkspec if the compiler binaries ABI matches the target ABI. * Linux-generic is compatible with all other linuxes (both ways) The targets themselves do additional filtering and will remove anything that does not work for them anyway. Task-number: QTCREATORBUG-5756 Task-number: QTCREATORBUG-5960 Change-Id: Ib3c0ac91f3aa8e2a823e3e9891a02bdccb97af14 Reviewed-on: http://codereview.qt-project.org/4281 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Diffstat (limited to 'src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp')
-rw-r--r--src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp35
1 files changed, 7 insertions, 28 deletions
diff --git a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp
index 65d5ca9c6a..28ce0ee07b 100644
--- a/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp
+++ b/src/plugins/qt4projectmanager/qt-desktop/desktopqtversion.cpp
@@ -44,15 +44,13 @@ using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;
DesktopQtVersion::DesktopQtVersion()
- : BaseQtVersion(),
- m_qtAbisUpToDate(false)
+ : BaseQtVersion()
{
}
DesktopQtVersion::DesktopQtVersion(const QString &path, bool isAutodetected, const QString &autodetectionSource)
- : BaseQtVersion(path, isAutodetected, autodetectionSource),
- m_qtAbisUpToDate(false)
+ : BaseQtVersion(path, isAutodetected, autodetectionSource)
{
}
@@ -72,38 +70,19 @@ QString DesktopQtVersion::type() const
return QtSupport::Constants::DESKTOPQT;
}
-bool DesktopQtVersion::isValid() const
-{
- if (!BaseQtVersion::isValid())
- return false;
- if (qtAbis().isEmpty())
- return false;
- return true;
-}
-
-QString DesktopQtVersion::invalidReason() const
-{
- QString tmp = BaseQtVersion::invalidReason();
- if (tmp.isEmpty() && qtAbis().isEmpty())
- return QCoreApplication::translate("QtVersion", "Failed to detect the ABI(s) used by the Qt version.");
- return tmp;
-}
-
QString DesktopQtVersion::warningReason() const
{
+ if (qtAbis().count() == 1 && qtAbis().first().isNull())
+ return QCoreApplication::translate("QtVersion", "ABI detection failed: Make sure to use a matching tool chain when building.");
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
return QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
return QString();
}
-QList<ProjectExplorer::Abi> DesktopQtVersion::qtAbis() const
+QList<ProjectExplorer::Abi> DesktopQtVersion::detectQtAbis() const
{
- if (!m_qtAbisUpToDate) {
- m_qtAbisUpToDate = true;
- ensureMkSpecParsed();
- m_qtAbis = qtAbisFromLibrary(qtCorePath(versionInfo(), qtVersionString()));
- }
- return m_qtAbis;
+ ensureMkSpecParsed();
+ return qtAbisFromLibrary(qtCorePath(versionInfo(), qtVersionString()));
}
bool DesktopQtVersion::supportsTargetId(const QString &id) const