summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@nokia.com>2011-11-24 16:03:19 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-28 13:35:42 +0100
commitca572a61446ba5cdae523614c874a09347b8e919 (patch)
treee8631877b07f923487833f9778d06eae8d58b9e8 /qmake
parentab79c7c092079ee7b3949a7b5ad7ea2faccb1659 (diff)
qmake: Allow extra compilers to have the makefile depend on its inputs
And enable this configuration option for the resource compiler. This results in a re-run of qmake whenever you touch a qrc file, which is needed to keep the dependencies up to date. Otherwise you might end up in the situation where you add a file to a qrc, edit the file some time later, but a rebuild does not regenerate a cpp file and compile that, so the final binary is stale. Technically this dependency problem is present for all source files, and qrc files are no different than any cpp file that you add a new header #include to, or adding a Q_OBJECT macro to a header. To pick up these changes we have to re-run qmake, so that qmake can run its internal dependency checking, and any extra compiler dependency commands. The reason we're making this change for rcc files it that conceptually people treat them as a "project" files, and expect them to behave similarly to .pro or .pri files, in that editing the file will invalidate the makefile. In practice this is often what happens when adding new headers, as you touch the project file when changing the HEADERS variable. Task-number: QTBUG-13334 Change-Id: If69149678e7fba6d812d31dcc17877427f9a6122 Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com> Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/makefile.cpp13
-rw-r--r--qmake/generators/makefile.h9
2 files changed, 17 insertions, 5 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index c7ea592cc0..d08f214c0c 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -604,6 +604,8 @@ MakefileGenerator::init()
compiler.flags |= Compiler::CompilerRemoveNoExist;
if(v[(*it) + ".CONFIG"].indexOf("no_dependencies") != -1)
compiler.flags |= Compiler::CompilerNoCheckDeps;
+ if(v[(*it) + ".CONFIG"].indexOf("add_inputs_as_makefile_deps") != -1)
+ compiler.flags |= Compiler::CompilerAddInputsAsMakefileDeps;
QString dep_type;
if(!project->isEmpty((*it) + ".dependency_type"))
@@ -766,9 +768,18 @@ MakefileGenerator::init()
//add to dependency engine
for(x = 0; x < compilers.count(); ++x) {
const MakefileGenerator::Compiler &comp = compilers.at(x);
- if(!(comp.flags & Compiler::CompilerNoCheckDeps))
+ if(!(comp.flags & Compiler::CompilerNoCheckDeps)) {
addSourceFiles(v[comp.variable_in], QMakeSourceFileInfo::SEEK_DEPS,
(QMakeSourceFileInfo::SourceFileType)comp.type);
+
+ if (comp.flags & Compiler::CompilerAddInputsAsMakefileDeps) {
+ QStringList &l = v[comp.variable_in];
+ for (int i=0; i < l.size(); ++i) {
+ if(v["QMAKE_INTERNAL_INCLUDED_FILES"].indexOf(l.at(i)) == -1)
+ v["QMAKE_INTERNAL_INCLUDED_FILES"].append(l.at(i));
+ }
+ }
+ }
}
}
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index df718f9cb4..26b5f0e659 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -159,10 +159,11 @@ protected:
{
QString variable_in;
enum CompilerFlag {
- CompilerNoFlags = 0x00,
- CompilerBuiltin = 0x01,
- CompilerNoCheckDeps = 0x02,
- CompilerRemoveNoExist = 0x04
+ CompilerNoFlags = 0x00,
+ CompilerBuiltin = 0x01,
+ CompilerNoCheckDeps = 0x02,
+ CompilerRemoveNoExist = 0x04,
+ CompilerAddInputsAsMakefileDeps = 0x08
};
uint flags, type;
};