From 552741143724e43d8b06132537b389da7e4ff837 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 24 Nov 2014 19:51:32 +0100 Subject: [PATCH] remove pointless fixPathToTargetOS() calls it makes no sense to call it on paths that are fixified right before or after, as fileFixify() calls it itself. and verifyExtraCompiler() calls normalizePath() on its file argument. Change-Id: I8fb21e129fd29428d1855de73483087842bc1bdd Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 19 ++++++++----------- qmake/generators/unix/unixmake.cpp | 3 +-- qmake/generators/unix/unixmake2.cpp | 2 +- qmake/generators/win32/msvc_nmake.cpp | 3 +-- qmake/generators/win32/winmakefile.cpp | 5 ++--- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 3e06f3fec00..5c0fd046bc7 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -725,8 +725,7 @@ MakefileGenerator::init() if((*input).isEmpty()) continue; QString inpf = (*input).toQString(); - QString in = Option::fixPathToTargetOS(inpf, false); - if (!verifyExtraCompiler((*it).toQString(), in)) //verify + if (!verifyExtraCompiler((*it).toQString(), inpf)) //verify continue; QString out = replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString(), NoShell); out = fileFixify(out, Option::output_dir, Option::output_dir); @@ -1052,7 +1051,7 @@ MakefileGenerator::writeProjectMakefile() writeSubTargets(t, targets, SubTargetsNoFlags); if(!project->isActiveConfig("no_autoqmake")) { - QString mkf = escapeDependencyPath(Option::fixPathToTargetOS(fileFixify(Option::output.fileName()))); + QString mkf = escapeDependencyPath(fileFixify(Option::output.fileName())); for(QList::Iterator it = targets.begin(); it != targets.end(); ++it) t << escapeDependencyPath((*it)->makefile) << ": " << mkf << endl; } @@ -1509,7 +1508,6 @@ MakefileGenerator::createObjectList(const ProStringList &sources) if (project->isActiveConfig("object_parallel_to_source")) { // The source paths are relative to the output dir, but we need source-relative paths QString sourceRelativePath = fileFixify(sfn, qmake_getpwd(), Option::output_dir); - sourceRelativePath = Option::fixPathToTargetOS(sourceRelativePath, false); if (sourceRelativePath.startsWith(".." + Option::dir_sep)) sourceRelativePath = fileFixify(sourceRelativePath, FileFixifyAbsolute); @@ -1732,7 +1730,7 @@ MakefileGenerator::verifyExtraCompiler(const ProString &comp, const QString &fil if((*input).isEmpty()) continue; QString inpf = (*input).toQString(); - QString in = fileFixify(Option::fixPathToTargetOS(inpf, false)); + QString in = fileFixify(inpf); if(in == file) { bool pass = project->test(verify.toKey(), QList() << ProStringList(replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString(), NoShell)) << @@ -1764,7 +1762,7 @@ MakefileGenerator::verifyExtraCompiler(const ProString &comp, const QString &fil if((*input).isEmpty()) continue; QString inpf = (*input).toQString(); - QString in = fileFixify(Option::fixPathToTargetOS(inpf, false)); + QString in = fileFixify(inpf); if(in == file) { QString out = replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell); QString cmd = replaceExtraCompilerVariables(tmp_cmd, in, out, LocalShell); @@ -1832,8 +1830,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) for (ProStringList::ConstIterator it2 = comp_inputs.begin(); it2 != comp_inputs.end(); ++it2) { const ProStringList &tmp = project->values((*it2).toKey()); for (ProStringList::ConstIterator input = tmp.begin(); input != tmp.end(); ++input) { - QString in = Option::fixPathToTargetOS((*input).toQString(), false); - if(verifyExtraCompiler((*it), in)) + if (verifyExtraCompiler((*it), (*input).toQString())) tmp_inputs.append((*input)); } } @@ -2250,7 +2247,7 @@ QString MakefileGenerator::build_args(const QString &outdir) ret += buildArgs(); //output - QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); + QString ofile = fileFixify(Option::output.fileName()); if(!ofile.isEmpty() && ofile != project->first("QMAKE_MAKEFILE")) ret += " -o " + escapeFilePath(ofile); @@ -2579,7 +2576,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QListisEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) { QStringList files = escapeFilePaths(fileFixify(Option::mkfile::project_files)); t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t" diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 4ee18c46ab3..3a76d898edb 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -716,10 +716,9 @@ UnixMakefileGenerator::defaultInstall(const QString &t) const QString root = "$(INSTALL_ROOT)"; ProStringList &uninst = project->values(ProKey(t + ".uninstall")); QString ret, destdir = project->first("DESTDIR").toQString(); - QString targetdir = Option::fixPathToTargetOS(project->first("target.path").toQString(), false); if(!destdir.isEmpty() && destdir.right(1) != Option::dir_sep) destdir += Option::dir_sep; - targetdir = fileFixify(targetdir, FileFixifyAbsolute); + QString targetdir = fileFixify(project->first("target.path").toQString(), FileFixifyAbsolute); if(targetdir.right(1) != Option::dir_sep) targetdir += Option::dir_sep; diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index ea9a03b174e..c14395ae276 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1056,7 +1056,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } t << fileVarGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n"); { - QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); + QString ofile = fileFixify(Option::output.fileName()); if(!ofile.isEmpty()) t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl; } diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 450f224654a..ae888cb96dc 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -252,8 +252,7 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t) const QString root = "$(INSTALL_ROOT)"; ProStringList &uninst = project->values(ProKey(t + ".uninstall")); - QString targetdir = Option::fixPathToTargetOS(project->first(ProKey(t + ".path")).toQString(), false); - targetdir = fileFixify(targetdir, FileFixifyAbsolute); + QString targetdir = fileFixify(project->first(ProKey(t + ".path")).toQString(), FileFixifyAbsolute); if(targetdir.right(1) != Option::dir_sep) targetdir += Option::dir_sep; diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 69a3e9c783d..5458e8f2c4b 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -581,7 +581,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t) } t << "\n\t-$(DEL_FILE) $(DESTDIR_TARGET)\n"; { - QString ofile = Option::fixPathToTargetOS(fileFixify(Option::output.fileName())); + QString ofile = fileFixify(Option::output.fileName()); if(!ofile.isEmpty()) t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl; } @@ -803,8 +803,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t) const QString root = "$(INSTALL_ROOT)"; ProStringList &uninst = project->values(ProKey(t + ".uninstall")); QString ret; - QString targetdir = Option::fixPathToTargetOS(project->first(ProKey(t + ".path")).toQString(), false); - targetdir = fileFixify(targetdir, FileFixifyAbsolute); + QString targetdir = fileFixify(project->first(ProKey(t + ".path")).toQString(), FileFixifyAbsolute); if(targetdir.right(1) != Option::dir_sep) targetdir += Option::dir_sep;