summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2021-02-01 11:11:59 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-02-08 15:21:02 +0000
commitbd75dd929c89b4d2b3257c26786330dc1507a478 (patch)
treee02810afacdd30f4a62a792863feb12175143310
parent777805daa6d1a074baae321179157b36288c5457 (diff)
qmake: Introduce compile_included_sources CONFIG option
By default, qmake does not compile source files that are included in other source files. The new CONFIG option compile_included_sources disables this behavior. Fixes: QTBUG-90801 Change-Id: I60c997938895f3a743d32ea385efdbe6bcf315bb Reviewed-by: Kai Koehne <kai.koehne@qt.io> (cherry picked from commit 134ee7d932391c7b3c1b801e64e4f5693c3cdd20) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--qmake/doc/src/qmake-manual.qdoc3
-rw-r--r--qmake/generators/makefile.cpp9
-rw-r--r--qmake/generators/makefile.h5
3 files changed, 13 insertions, 4 deletions
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index a96b84e63b..d52f02e9a0 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -1241,6 +1241,9 @@
subproject.
\row \li no_include_pwd \li Do not add the current directory to
INCLUDEPATHS.
+ \row \li compile_included_sources \li By default, qmake does not
+ compile source files that are included in other source files. This
+ option disables this behavior.
\endtable
When you use the \c debug_and_release option (which is the default under
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 01f3d076bc..dd01ba210b 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -945,6 +945,15 @@ MakefileGenerator::filterIncludedFiles(const char *var)
inputs.end());
}
+void MakefileGenerator::processSources()
+{
+ if (project->isActiveConfig("compile_included_sources"))
+ return;
+
+ filterIncludedFiles("SOURCES");
+ filterIncludedFiles("GENERATED_SOURCES");
+}
+
static QString
qv(const ProString &val)
{
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 3adde4b96f..e5a722f8ad 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -194,10 +194,7 @@ protected:
virtual bool doDepends() const { return Option::mkfile::do_deps; }
void filterIncludedFiles(const char *);
- void processSources() {
- filterIncludedFiles("SOURCES");
- filterIncludedFiles("GENERATED_SOURCES");
- }
+ void processSources();
//for installs
virtual QString defaultInstall(const QString &);