forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -44,15 +44,13 @@ using namespace Qt4ProjectManager;
|
||||
using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
SimulatorQtVersion::SimulatorQtVersion()
|
||||
: QtSupport::BaseQtVersion(),
|
||||
m_qtAbisUpToDate(false)
|
||||
: QtSupport::BaseQtVersion()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
SimulatorQtVersion::SimulatorQtVersion(const QString &path, bool isAutodetected, const QString &autodetectionSource)
|
||||
: QtSupport::BaseQtVersion(path, isAutodetected, autodetectionSource),
|
||||
m_qtAbisUpToDate(false)
|
||||
: QtSupport::BaseQtVersion(path, isAutodetected, autodetectionSource)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -72,38 +70,19 @@ QString SimulatorQtVersion::type() const
|
||||
return QtSupport::Constants::SIMULATORQT;
|
||||
}
|
||||
|
||||
bool SimulatorQtVersion::isValid() const
|
||||
{
|
||||
if (!BaseQtVersion::isValid())
|
||||
return false;
|
||||
if (qtAbis().isEmpty())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
QString SimulatorQtVersion::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 SimulatorQtVersion::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> SimulatorQtVersion::qtAbis() const
|
||||
QList<ProjectExplorer::Abi> SimulatorQtVersion::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 SimulatorQtVersion::supportsTargetId(const QString &id) const
|
||||
@@ -120,4 +99,3 @@ QString SimulatorQtVersion::description() const
|
||||
{
|
||||
return QCoreApplication::translate("QtVersion", "Qt Simulator", "Qt Version is meant for Qt Simulator");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user