untangle handling extra compiler .clean member
it's easy when it is a simple list of files (or just absent). however, it can also contain expandos, and in this case it's definitely not a good idea to treat it partly (but not really) as a single shell command. Change-Id: I7ef32a56f276b06579fc7094357c5f7612eaf205 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
parent
6c4d8ee835
commit
0812b5b318
@ -1852,7 +1852,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
t << endl;
|
t << endl;
|
||||||
|
|
||||||
if (config.indexOf("no_clean") == -1) {
|
if (config.indexOf("no_clean") == -1) {
|
||||||
QString tmp_clean = escapeFilePaths(project->values(ProKey(*it + ".clean"))).join(' ');
|
const ProStringList &raw_clean = project->values(ProKey(*it + ".clean"));
|
||||||
|
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())
|
||||||
clean_targets += QString("compiler_" + (*it) + "_clean ");
|
clean_targets += QString("compiler_" + (*it) + "_clean ");
|
||||||
@ -1871,28 +1872,31 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
wrote_clean = true;
|
wrote_clean = true;
|
||||||
}
|
}
|
||||||
if(!wrote_clean_cmds || !wrote_clean) {
|
if(!wrote_clean_cmds || !wrote_clean) {
|
||||||
ProStringList cleans;
|
QStringList q_raw_clean = raw_clean.toQStringList();
|
||||||
|
QStringList cleans;
|
||||||
const QString del_statement("-$(DEL_FILE)");
|
const QString del_statement("-$(DEL_FILE)");
|
||||||
if(!wrote_clean) {
|
if(!wrote_clean) {
|
||||||
if(project->isActiveConfig("no_delete_multiple_files")) {
|
QStringList dels;
|
||||||
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();
|
||||||
cleans.append(" " + Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_clean, tinp,
|
QString out = replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell);
|
||||||
replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell), TargetShell)));
|
foreach (const QString &rc, q_raw_clean) {
|
||||||
|
dels << ' ' + escapeFilePath(Option::fixPathToTargetOS(
|
||||||
|
replaceExtraCompilerVariables(rc, tinp, out, NoShell), false));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(project->isActiveConfig("no_delete_multiple_files")) {
|
||||||
|
cleans = dels;
|
||||||
} else {
|
} else {
|
||||||
QString files, file;
|
QString files;
|
||||||
const int commandlineLimit = 2047; // NT limit, expanded
|
const int commandlineLimit = 2047; // NT limit, expanded
|
||||||
for(int input = 0; input < tmp_inputs.size(); ++input) {
|
foreach (const QString &file, dels) {
|
||||||
QString tinp = tmp_inputs.at(input).toQString();
|
|
||||||
file = " " + replaceExtraCompilerVariables(tmp_clean, tinp,
|
|
||||||
replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell), TargetShell);
|
|
||||||
if(del_statement.length() + files.length() +
|
if(del_statement.length() + files.length() +
|
||||||
qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
|
qMax(fixEnvVariables(file).length(), file.length()) > commandlineLimit) {
|
||||||
cleans.append(files);
|
cleans.append(files);
|
||||||
files.clear();
|
files.clear();
|
||||||
}
|
}
|
||||||
files += Option::fixPathToTargetOS(file);
|
files += file;
|
||||||
}
|
}
|
||||||
if(!files.isEmpty())
|
if(!files.isEmpty())
|
||||||
cleans.append(files);
|
cleans.append(files);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user