untangle handling extra compiler .clean member, take 2
fixes clean targets of (most) extra compilers being empty. amends commit 0812b5b3188. Task-number: QTBUG-45132 Change-Id: I069bca124587df261597a4f8183a4695cd834e29 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
parent
5fb0b71a12
commit
f228404c24
@ -1850,7 +1850,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
t << endl;
|
t << endl;
|
||||||
|
|
||||||
if (config.indexOf("no_clean") == -1) {
|
if (config.indexOf("no_clean") == -1) {
|
||||||
const ProStringList &raw_clean = project->values(ProKey(*it + ".clean"));
|
QStringList raw_clean = project->values(ProKey(*it + ".clean")).toQStringList();
|
||||||
|
if (raw_clean.isEmpty())
|
||||||
|
raw_clean << tmp_out;
|
||||||
QString tmp_clean = escapeFilePaths(raw_clean).join(' ');
|
QString tmp_clean = escapeFilePaths(raw_clean).join(' ');
|
||||||
QString tmp_clean_cmds = project->values(ProKey(*it + ".clean_commands")).join(' ');
|
QString tmp_clean_cmds = project->values(ProKey(*it + ".clean_commands")).join(' ');
|
||||||
if(!tmp_inputs.isEmpty())
|
if(!tmp_inputs.isEmpty())
|
||||||
@ -1863,14 +1865,11 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
t << "\n\t" << tmp_clean_cmds;
|
t << "\n\t" << tmp_clean_cmds;
|
||||||
wrote_clean_cmds = true;
|
wrote_clean_cmds = true;
|
||||||
}
|
}
|
||||||
if(tmp_clean.isEmpty())
|
|
||||||
tmp_clean = escapeFilePath(tmp_out);
|
|
||||||
if(tmp_clean.indexOf("${QMAKE_") == -1) {
|
if(tmp_clean.indexOf("${QMAKE_") == -1) {
|
||||||
t << "\n\t-$(DEL_FILE) " << tmp_clean;
|
t << "\n\t-$(DEL_FILE) " << tmp_clean;
|
||||||
wrote_clean = true;
|
wrote_clean = true;
|
||||||
}
|
}
|
||||||
if(!wrote_clean_cmds || !wrote_clean) {
|
if(!wrote_clean_cmds || !wrote_clean) {
|
||||||
QStringList q_raw_clean = raw_clean.toQStringList();
|
|
||||||
QStringList cleans;
|
QStringList cleans;
|
||||||
const QString del_statement("-$(DEL_FILE)");
|
const QString del_statement("-$(DEL_FILE)");
|
||||||
if(!wrote_clean) {
|
if(!wrote_clean) {
|
||||||
@ -1878,7 +1877,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
|
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
|
||||||
QString tinp = (*input).toQString();
|
QString tinp = (*input).toQString();
|
||||||
QString out = replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell);
|
QString out = replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell);
|
||||||
foreach (const QString &rc, q_raw_clean) {
|
foreach (const QString &rc, raw_clean) {
|
||||||
dels << ' ' + escapeFilePath(Option::fixPathToTargetOS(
|
dels << ' ' + escapeFilePath(Option::fixPathToTargetOS(
|
||||||
replaceExtraCompilerVariables(rc, tinp, out, NoShell), false));
|
replaceExtraCompilerVariables(rc, tinp, out, NoShell), false));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user