Share the code for determining used qmake arguments.

Move the code that compares the Qt version's debug|release property
with the build configuration's debug|release property
to the new build configuration class.

Reviewed-by: dt
This commit is contained in:
con
2009-12-02 17:43:43 +01:00
parent 65c80300a9
commit f3bdeb8c9a
9 changed files with 59 additions and 92 deletions

View File

@@ -286,22 +286,11 @@ void S60DeviceRunConfiguration::updateTarget()
reader->setCumulative(false);
reader->setQtVersion(qtVersion);
// Find out what flags we pass on to qmake, this code is duplicated in the qmake step
QtVersion::QmakeBuildConfigs defaultBuildConfiguration = qtVersion->defaultBuildConfig();
QtVersion::QmakeBuildConfigs projectBuildConfiguration =
QtVersion::QmakeBuildConfigs(qt4bc->value("buildConfiguration").toInt());
// Find out what flags we pass on to qmake
QStringList addedUserConfigArguments;
QStringList removedUserConfigArguments;
if ((defaultBuildConfiguration & QtVersion::BuildAll) && !(projectBuildConfiguration & QtVersion::BuildAll))
removedUserConfigArguments << "debug_and_release";
if (!(defaultBuildConfiguration & QtVersion::BuildAll) && (projectBuildConfiguration & QtVersion::BuildAll))
addedUserConfigArguments << "debug_and_release";
if ((defaultBuildConfiguration & QtVersion::DebugBuild) && !(projectBuildConfiguration & QtVersion::DebugBuild))
addedUserConfigArguments << "release";
if (!(defaultBuildConfiguration & QtVersion::DebugBuild) && (projectBuildConfiguration & QtVersion::DebugBuild))
addedUserConfigArguments << "debug";
reader->setUserConfigCmdArgs(addedUserConfigArguments, removedUserConfigArguments);
qt4bc->getConfigCommandLineArguments(&addedUserConfigArguments, &removedUserConfigArguments);
reader->setConfigCommandLineArguments(addedUserConfigArguments, removedUserConfigArguments);
if (!reader->readProFile(m_proFilePath)) {
delete reader;
@@ -346,7 +335,7 @@ void S60DeviceRunConfiguration::updateTarget()
m_platform = QLatin1String("armv6");
break;
}
if (projectBuildConfiguration & QtVersion::DebugBuild)
if (qt4bc->qmakeBuildConfiguration() & QtVersion::DebugBuild)
m_target = QLatin1String("udeb");
else
m_target = QLatin1String("urel");