forked from qt-creator/qt-creator
QmlJS: Try to build qmldump when opening a Qml project.
To make plugin dumping work without having to compile the debugging helpers explicitly. Reviewed-by: Kai Koehne
This commit is contained in:
@@ -1746,7 +1746,7 @@ bool QtVersion::isQt64Bit() const
|
||||
#endif
|
||||
}
|
||||
|
||||
QString QtVersion::buildDebuggingHelperLibrary(QFutureInterface<void> &future)
|
||||
QString QtVersion::buildDebuggingHelperLibrary(QFutureInterface<void> &future, bool onlyQmlDump)
|
||||
{
|
||||
QString qtInstallHeaders = versionInfo().value("QT_INSTALL_HEADERS");
|
||||
QString qtInstallData = versionInfo().value("QT_INSTALL_DATA");
|
||||
@@ -1762,13 +1762,28 @@ QString QtVersion::buildDebuggingHelperLibrary(QFutureInterface<void> &future)
|
||||
return QCoreApplication::translate("QtVersion", "The Qt Version has no toolchain.");
|
||||
tc->addToEnvironment(env);
|
||||
QString output;
|
||||
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 (!onlyQmlDump) {
|
||||
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("")));
|
||||
}
|
||||
future.setProgressValue(2);
|
||||
|
||||
if (QmlObserverTool::canBuild(this)) {
|
||||
QString toolDirectory = QmlObserverTool::copy(qtInstallData, &output);
|
||||
if (!toolDirectory.isEmpty()) {
|
||||
output += QmlObserverTool::build(toolDirectory, tc->makeCommand(),
|
||||
qmakeCommand(), mkspec(), env,
|
||||
(tc->type() == ToolChain::GCC_MAEMO ? QLatin1String("-unix") : QLatin1String("")));
|
||||
}
|
||||
} else {
|
||||
output += QCoreApplication::tr("Cannot build QMLObserver; Qt version must be 4.7.1 or higher.");
|
||||
}
|
||||
future.setProgressValue(3);
|
||||
}
|
||||
future.setProgressValue(2);
|
||||
|
||||
if (QmlDumpTool::canBuild(this)) {
|
||||
QString toolDirectory = QmlDumpTool::copy(qtInstallData, &output);
|
||||
@@ -1780,28 +1795,17 @@ QString QtVersion::buildDebuggingHelperLibrary(QFutureInterface<void> &future)
|
||||
} else {
|
||||
output += QCoreApplication::tr("Cannot build qmldump; Qt version must be 4.7.1 or higher.");
|
||||
}
|
||||
future.setProgressValue(3);
|
||||
|
||||
if (QmlObserverTool::canBuild(this)) {
|
||||
QString toolDirectory = QmlObserverTool::copy(qtInstallData, &output);
|
||||
if (!toolDirectory.isEmpty()) {
|
||||
output += QmlObserverTool::build(toolDirectory, tc->makeCommand(),
|
||||
qmakeCommand(), mkspec(), env,
|
||||
(tc->type() == ToolChain::GCC_MAEMO ? QLatin1String("-unix") : QLatin1String("")));
|
||||
}
|
||||
} else {
|
||||
output += QCoreApplication::tr("Cannot build QMLObserver; Qt version must be 4.7.1 or higher.");
|
||||
}
|
||||
future.setProgressValue(4);
|
||||
|
||||
// invalidate version before updating version info
|
||||
m_versionInfoUpToDate = false;
|
||||
updateVersionInfo();
|
||||
|
||||
m_hasDebuggingHelper = !debuggingHelperLibrary().isEmpty();
|
||||
if (!onlyQmlDump) {
|
||||
m_hasDebuggingHelper = !debuggingHelperLibrary().isEmpty();
|
||||
m_hasQmlObserver = !qmlObserverTool().isEmpty();
|
||||
}
|
||||
m_hasQmlDump = !qmlDumpTool().isEmpty();
|
||||
m_hasQmlObserver = !qmlObserverTool().isEmpty();
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user