From 0f88c5c1b99336a328f9a7123903fbc006251ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 1 Dec 2014 16:36:13 +0100 Subject: qmake: Add .qmake.stash/super to QMAKE_DISTCLEAN when owned by project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Running 'make distclean' should remove all files generated by qmake, including .qmake.stash/super. These files are considered owned by a particular project (and hence a candidate for distclean), if it lives in the same directory as the output dir of the project. Task-number: QTBUG-42678 Change-Id: I224e9bac039eeacb6561e18acc7f8e867da5dab8 Reviewed-by: Oswald Buddenhagen Reviewed-by: Tor Arne Vestbø --- qmake/generators/makefile.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index bf9a9d8343..4c501983d8 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -444,6 +444,22 @@ MakefileGenerator::init() setSystemIncludes(v["QMAKE_DEFAULT_INCDIRS"]); + const char * const cacheKeys[] = { "_QMAKE_STASH_", "_QMAKE_SUPER_CACHE_", 0 }; + for (int i = 0; cacheKeys[i]; ++i) { + if (v[cacheKeys[i]].isEmpty()) + continue; + const ProString &file = v[cacheKeys[i]].first(); + if (file.isEmpty()) + continue; + + QFileInfo fi(fileInfo(file.toQString())); + + // If the file lives in the output dir we treat it as 'owned' by + // the current project, so it should be distcleaned by it as well. + if (fi.path() == Option::output_dir) + v["QMAKE_DISTCLEAN"].append(fi.fileName()); + } + ProStringList &quc = v["QMAKE_EXTRA_COMPILERS"]; //make sure the COMPILERS are in the correct input/output chain order -- cgit v1.2.3