Commit a4a05aef authored by Kai Koehne's avatar Kai Koehne

QMakeStep: Honor declarative_debug configuration for imported builds

Honor the qmake line that is imported: If it contains declarative_debug
or QMLJSDEBUGGER_PATH, also set the option in the qmake step, if not
not.

Change-Id: Ibc524ff8d39b66f76cc79807264db0dd3534e2d7
Reviewed-on: http://codereview.qt-project.org/4090Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 2d8acad3
......@@ -180,7 +180,7 @@ ProjectExplorer::Target *Qt4DesktopTargetFactory::create(ProjectExplorer::Projec
foreach (const BuildConfigurationInfo &info, infos)
t->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(),
info.version, info.buildConfig,
info.additionalArguments, info.directory);
info.additionalArguments, info.directory, info.importing);
t->addDeployConfiguration(t->createDeployConfiguration(ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID));
......
......@@ -164,7 +164,7 @@ ProjectExplorer::Target *Qt4SimulatorTargetFactory::create(ProjectExplorer::Proj
foreach (const BuildConfigurationInfo &info, infos)
t->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(), info.version, info.buildConfig,
info.additionalArguments, info.directory);
info.additionalArguments, info.directory, info.importing);
t->addDeployConfiguration(t->createDeployConfiguration(ProjectExplorer::Constants::DEFAULT_DEPLOYCONFIGURATION_ID));
......
......@@ -225,7 +225,7 @@ ProjectExplorer::Target *Qt4SymbianTargetFactory::create(ProjectExplorer::Projec
foreach (const BuildConfigurationInfo &info, infos)
t->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(),
info.version, info.buildConfig,
info.additionalArguments, info.directory);
info.additionalArguments, info.directory, info.importing);
t->addDeployConfiguration(t->createDeployConfiguration(QLatin1String(Qt4ProjectManager::Constants::S60_DEVICE_TARGET_ID)));
......
......@@ -531,11 +531,16 @@ bool Qt4BuildConfiguration::compareToImportFrom(const QString &makefile)
return false;
}
void Qt4BuildConfiguration::removeQMLInspectorFromArguments(QString *args)
bool Qt4BuildConfiguration::removeQMLInspectorFromArguments(QString *args)
{
for (Utils::QtcProcess::ArgIterator ait(args); ait.next(); )
if (ait.value().contains(QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH)))
bool removedArgument = false;
for (Utils::QtcProcess::ArgIterator ait(args); ait.next(); ) {
if (ait.value().contains(QLatin1String(Constants::QMAKEVAR_QMLJSDEBUGGER_PATH))) {
ait.deleteArg();
removedArgument = true;
}
}
return removedArgument;
}
QString Qt4BuildConfiguration::extractSpecFromArguments(QString *args,
......@@ -745,7 +750,7 @@ BuildConfiguration *Qt4BuildConfigurationFactory::create(ProjectExplorer::Target
BuildConfiguration *bc = qt4Target->addQt4BuildConfiguration(defaultDebugName, customDebugName,
version,
(version->defaultBuildConfig() | QtSupport::BaseQtVersion::DebugBuild),
QString(), QString());
QString(), QString(), false);
if (qt4Target->id() != Constants::S60_EMULATOR_TARGET_ID) {
//: Release build configuration. We recommend not translating it.
......@@ -757,7 +762,7 @@ BuildConfiguration *Qt4BuildConfigurationFactory::create(ProjectExplorer::Target
bc = qt4Target->addQt4BuildConfiguration(defaultReleaseName, customReleaseName,
version,
(version->defaultBuildConfig() & ~QtSupport::BaseQtVersion::DebugBuild),
QString(), QString());
QString(), QString(), false);
}
return bc;
}
......@@ -832,13 +837,15 @@ void Qt4BuildConfiguration::importFromBuildDirectory()
QString additionalArguments = result.second;
QString parsedSpec = Qt4BuildConfiguration::extractSpecFromArguments(&additionalArguments, directory, version);
Qt4BuildConfiguration::removeQMLInspectorFromArguments(&additionalArguments);
const bool enableQmlDebugger =
Qt4BuildConfiguration::removeQMLInspectorFromArguments(&additionalArguments);
// So we got all the information now apply it...
setQtVersion(version);
QMakeStep *qs = qmakeStep();
qs->setUserArguments(additionalArguments);
qs->setLinkQmlDebuggingLibrary(enableQmlDebugger);
if (!parsedSpec.isEmpty() && parsedSpec != QLatin1String("default") && qs->mkspec() != parsedSpec) {
Utils::QtcProcess::addArgs(&additionalArguments, (QStringList() << "-spec" << parsedSpec));
qs->setUserArguments(additionalArguments);
......
......@@ -107,7 +107,7 @@ public:
QString makefile() const;
bool compareToImportFrom(const QString &makefile);
static void removeQMLInspectorFromArguments(QString *args);
static bool removeQMLInspectorFromArguments(QString *args);
static QString extractSpecFromArguments(QString *arguments,
const QString &directory, const QtSupport::BaseQtVersion *version,
QStringList *outArgs = 0);
......
......@@ -126,7 +126,7 @@ QList<BuildConfigurationInfo> Qt4BaseTargetFactory::availableBuildConfigurations
if (!version->isValid() || !version->toolChainAvailable(id))
continue;
QtSupport::BaseQtVersion::QmakeBuildConfigs config = version->defaultBuildConfig();
BuildConfigurationInfo info = BuildConfigurationInfo(version, config, QString(), QString());
BuildConfigurationInfo info = BuildConfigurationInfo(version, config, QString(), QString(), false, false);
info.directory = shadowBuildDirectory(proFilePath, id, msgBuildConfigurationName(info));
infoList.append(info);
......@@ -299,7 +299,8 @@ Qt4BuildConfiguration *Qt4BaseTarget::addQt4BuildConfiguration(QString defaultDi
QString displayName, QtSupport::BaseQtVersion *qtversion,
QtSupport::BaseQtVersion::QmakeBuildConfigs qmakeBuildConfiguration,
QString additionalArguments,
QString directory)
QString directory,
bool importing)
{
Q_ASSERT(qtversion);
bool debug = qmakeBuildConfiguration & QtSupport::BaseQtVersion::DebugBuild;
......@@ -324,8 +325,13 @@ Qt4BuildConfiguration *Qt4BaseTarget::addQt4BuildConfiguration(QString defaultDi
cleanStep->setClean(true);
cleanStep->setUserArguments("clean");
cleanSteps->insertStep(0, cleanStep);
bool enableQmlDebugger
= Qt4BuildConfiguration::removeQMLInspectorFromArguments(&additionalArguments);
if (!additionalArguments.isEmpty())
qmakeStep->setUserArguments(additionalArguments);
if (importing)
qmakeStep->setLinkQmlDebuggingLibrary(enableQmlDebugger);
// set some options for qmake and make
if (qmakeBuildConfiguration & QtSupport::BaseQtVersion::BuildAll) // debug_and_release => explicit targets
......@@ -1144,7 +1150,6 @@ BuildConfigurationInfo BuildConfigurationInfo::checkForBuild(const QString &dire
specArgument = "-spec " + Utils::QtcProcess::quoteArg(parsedSpec);
}
Utils::QtcProcess::addArgs(&specArgument, additionalArguments);
Qt4BuildConfiguration::removeQMLInspectorFromArguments(&specArgument);
BuildConfigurationInfo info = BuildConfigurationInfo(version,
makefileBuildConfig.first,
......
......@@ -82,7 +82,8 @@ public:
QtSupport::BaseQtVersion *qtversion,
QtSupport::BaseQtVersion::QmakeBuildConfigs qmakeBuildConfiguration,
QString additionalArguments,
QString directory);
QString directory,
bool importing);
virtual void createApplicationProFiles() = 0;
......
......@@ -214,7 +214,7 @@ ProjectExplorer::Target *Qt4MaemoTargetFactory::create(ProjectExplorer::Project
foreach (const BuildConfigurationInfo &info, infos)
target->addQt4BuildConfiguration(msgBuildConfigurationName(info), QString(),
info.version, info.buildConfig,
info.additionalArguments, info.directory);
info.additionalArguments, info.directory, info.importing);
foreach (const QString &deployConfigId, deployConfigIds) {
target->addDeployConfiguration(target->createDeployConfiguration(deployConfigId));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment