Sanitize QMAKE_EXTRA_COMPILERS paths in makefiles

There was a mismatch of how we sanitized paths for dependencies of the
target and how those dependencies were sanitized (or not sanitized),
resulting in the target depending on 'some/path/foo.o' while the
extra compiler target was named 'some/path//foo.o', with an extra
slash. This confused 'make' enough to decide that it didn't know
how to build the dependencies for the target.

Change-Id: I181b86c291286cbbbb1f7b4c3b929a5f1dc163a3
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Tor Arne Vestbø 2013-09-18 18:32:53 +02:00 committed by The Qt Project
parent 15e9c3301c
commit e582d742cc

View File

@ -1886,10 +1886,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if (config.indexOf("combine") != -1) {
// compilers with a combined input only have one output
QString input = project->first(ProKey(*it + ".output")).toQString();
t << " " << escapeDependencyPath(replaceExtraCompilerVariables(tmp_out, input, QString()));
t << " " << escapeDependencyPath(Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, input, QString())));
} else {
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
t << " " << escapeDependencyPath(replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString()));
t << " " << escapeDependencyPath(Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString())));
}
}
t << endl;
@ -1920,8 +1920,8 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
if(project->isActiveConfig("no_delete_multiple_files")) {
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
QString tinp = (*input).toQString();
cleans.append(" " + replaceExtraCompilerVariables(tmp_clean, tinp,
replaceExtraCompilerVariables(tmp_out, tinp, QString())));
cleans.append(" " + Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_clean, tinp,
replaceExtraCompilerVariables(tmp_out, tinp, QString()))));
}
} else {
QString files, file;
@ -1935,7 +1935,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
cleans.append(files);
files.clear();
}
files += file;
files += Option::fixPathToTargetOS(file);
}
if(!files.isEmpty())
cleans.append(files);
@ -2033,7 +2033,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QString out = replaceExtraCompilerVariables(tmp_out, QString(), QString());
QString cmd = replaceExtraCompilerVariables(tmp_cmd, escapeFilePaths(inputs), QStringList() << out);
t << escapeDependencyPath(out) << ":";
t << escapeDependencyPath(Option::fixPathToTargetOS(out)) << ":";
// compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies
if (config.indexOf("explicit_dependencies") != -1) {
t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, Option::output_dir, Option::output_dir)));
@ -2048,7 +2048,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QString in = Option::fixPathToTargetOS(inpf, false);
QStringList deps = findDependencies(inpf);
deps += escapeDependencyPath(in);
QString out = unescapeFilePath(replaceExtraCompilerVariables(tmp_out, inpf, QString()));
QString out = unescapeFilePath(Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, inpf, QString())));
if(!tmp_dep.isEmpty()) {
QStringList pre_deps = fileFixify(tmp_dep, Option::output_dir, Option::output_dir);
for(int i = 0; i < pre_deps.size(); ++i)