Compile qmldump with debugging helpers

Must be compiled during runtime - otherwise, the app may not work
with Qt that is compiled with another compiler.

Reviewed-by: hjk
This commit is contained in:
Lasse Holmstedt
2010-09-27 15:51:49 +02:00
parent cfe61f6431
commit 5d9858129a
21 changed files with 1093 additions and 257 deletions

View File

@@ -37,6 +37,7 @@
#include "qt-s60/s60manager.h"
#include "qt-s60/s60projectchecker.h"
#include "qmldumptool.h"
#include <projectexplorer/debugginghelper.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
@@ -1133,8 +1134,10 @@ void QtVersion::updateVersionInfo() const
QString qtInstallData = m_versionInfo.value("QT_INSTALL_DATA");
m_versionInfo.insert("QMAKE_MKSPECS", QDir::cleanPath(qtInstallData+"/mkspecs"));
if (!qtInstallData.isEmpty())
if (!qtInstallData.isEmpty()) {
m_hasDebuggingHelper = !DebuggingHelperLibrary::debuggingHelperLibraryByInstallData(qtInstallData).isEmpty();
m_hasQmlDump = !QmlDumpTool::qmlDumpToolByInstallData(qtInstallData).isEmpty();
}
}
// Now check for a qt that is configured with a prefix but not installed
@@ -1609,6 +1612,12 @@ bool QtVersion::hasDebuggingHelper() const
return m_hasDebuggingHelper;
}
bool QtVersion::hasQmlDump() const
{
updateVersionInfo();
return m_hasQmlDump;
}
QString QtVersion::debuggingHelperLibrary() const
{
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
@@ -1622,7 +1631,7 @@ QStringList QtVersion::debuggingHelperLibraryLocations() const
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
if (qtInstallData.isEmpty())
return QStringList();
return DebuggingHelperLibrary::debuggingHelperLibraryLocationsByInstallData(qtInstallData);
return DebuggingHelperLibrary::locationsByInstallData(qtInstallData);
}
bool QtVersion::supportsBinaryDebuggingHelper() const
@@ -1704,6 +1713,7 @@ bool QtVersion::isQt64Bit() const
QString QtVersion::buildDebuggingHelperLibrary()
{
QString qtInstallHeaders = versionInfo().value("QT_INSTALL_HEADERS");
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
if (qtInstallData.isEmpty())
return QString();
@@ -1717,12 +1727,23 @@ QString QtVersion::buildDebuggingHelperLibrary()
return QCoreApplication::translate("QtVersion", "The Qt Version has no toolchain.");
tc->addToEnvironment(env);
QString output;
QString directory = DebuggingHelperLibrary::copyDebuggingHelperLibrary(qtInstallData, &output);
if (!directory.isEmpty()) {
output += DebuggingHelperLibrary::buildDebuggingHelperLibrary(directory, tc->makeCommand(),
QString gdbHelperDirectory = DebuggingHelperLibrary::copy(qtInstallData, &output);
if (!gdbHelperDirectory.isEmpty()) {
output += DebuggingHelperLibrary::build(gdbHelperDirectory, tc->makeCommand(),
qmakeCommand(), mkspec(), env,
(tc->type() == ToolChain::GCC_MAEMO ? QLatin1String("-unix") : QLatin1String("")));
}
if (QmlDumpTool::canBuild(qtInstallHeaders)) {
QString qmlDumpDirectory = QmlDumpTool::copy(qtInstallData, &output);
if (!qmlDumpDirectory.isEmpty()) {
output += QmlDumpTool::build(qmlDumpDirectory, tc->makeCommand(),
qmakeCommand(), mkspec(), env,
(tc->type() == ToolChain::GCC_MAEMO ? QLatin1String("-unix") : QLatin1String("")));
}
} else {
output += QCoreApplication::tr("Cannot build qmldump; Qt version must be 4.7.1 or higher.");
}
m_hasDebuggingHelper = !debuggingHelperLibrary().isEmpty();
return output;
}