From bbb40616d25b1a1378050bca4de98ebc454bd2b7 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 3 Nov 2014 17:13:17 +0100 Subject: [PATCH] remove dead code In ancient times, the existence of QMAKE_RUN_CXX_IMP determined the use of implicit rules. The code path for implicit rules was turned off in 2006 (0287fe3c), which probably was a refactoring artifact. Later, implicit rules were enabled again using a different approach. These days, the non-existence of QMAKE_RUN_CXX determines the use of implicit rules. We remove the dead code path now and rely on the latter condition. One part of the dead code is a feature that turns off inference rules if the OBJECTS_DIR is set or source file names do not match expectations. If somebody ever missed this, it has been reimplemented otherwise. Or not. Change-Id: If3ce9904d9c1df6e4048c58c2452854cce7fa206 Reviewed-by: Oswald Buddenhagen --- qmake/generators/makefile.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 4c501983d8..3b807c4ccf 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1168,30 +1168,16 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src) t << escapeDependencyPath(dstf) << ": " << escapeDependencyPath(srcf) << " " << escapeDependencyPaths(findDependencies(srcf)).join(" \\\n\t\t"); - ProKey comp, cimp; + ProKey comp; for(QStringList::Iterator cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit) { if((*sit).endsWith((*cppit))) { comp = "QMAKE_RUN_CXX"; - cimp = "QMAKE_RUN_CXX_IMP"; break; } } - if(comp.isEmpty()) { + if (comp.isEmpty()) comp = "QMAKE_RUN_CC"; - cimp = "QMAKE_RUN_CC_IMP"; - } - bool use_implicit_rule = !project->isEmpty(cimp); - use_implicit_rule = false; - if(use_implicit_rule) { - if(!project->isEmpty("OBJECTS_DIR")) { - use_implicit_rule = false; - } else { - int dot = (*sit).lastIndexOf('.'); - if(dot == -1 || ((*sit).left(dot) + Option::obj_ext != (*oit))) - use_implicit_rule = false; - } - } - if (!use_implicit_rule && !project->isEmpty(comp)) { + if (!project->isEmpty(comp)) { QString p = var(comp); p.replace(stringSrc, escapeFilePath(srcf)); p.replace(stringObj, escapeFilePath(dstf));