summaryrefslogtreecommitdiffstats
path: root/build/qmake/mkspecs/features/gyp_generator.prf
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-06-19 14:54:59 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-06-19 15:00:05 +0200
commitde48295467098599ab1d80cb04a2de5236599b31 (patch)
tree11f106d2f54dc6acc3897054fd2062b8a07853f4 /build/qmake/mkspecs/features/gyp_generator.prf
parent943a8bd88695c3fbb9ed9d298469f1b77270c49e (diff)
Use Q_PRIVATE_SLOT for QWebContentsViewPrivate.
Fix the gyp generator to allow including the moc file directly in qwebcontentsview.cpp to be able to use Q_PRIVATE_SLOT instead of having the private object deriving from QObject. This also removes the use of MOCABLE_SOURCES whose entries were added to 'sources' without moc being run on them first.
Diffstat (limited to 'build/qmake/mkspecs/features/gyp_generator.prf')
-rw-r--r--build/qmake/mkspecs/features/gyp_generator.prf17
1 files changed, 13 insertions, 4 deletions
diff --git a/build/qmake/mkspecs/features/gyp_generator.prf b/build/qmake/mkspecs/features/gyp_generator.prf
index 2cb652331..b01a9bb6c 100644
--- a/build/qmake/mkspecs/features/gyp_generator.prf
+++ b/build/qmake/mkspecs/features/gyp_generator.prf
@@ -34,7 +34,7 @@ GYPI_FILE = $$replace(_PRO_FILE_, .pro$, .gyp)
TARGET_TYPE = $$toGypTargetType()
MOCABLE_HEADERS = $$findMocables($$HEADERS)
-MOCABLE_SOURCES = $$findMocables($$SOURCES)
+INCLUDED_MOC_FILES = $$findIncludedMocFiles($$SOURCES)
GYPI_CONTENTS = "{" \
" 'targets': [" \
@@ -74,20 +74,29 @@ GYPI_CONTENTS += " ],"
" }," \
" },"
}
+
+# Source files to compile
GYPI_CONTENTS += " 'sources': ["
for (sourcefile, SOURCES): GYPI_CONTENTS += " '$$sourcefile',"
for (headerfile, HEADERS): GYPI_CONTENTS += " '$$headerfile',"
+
+# Add moc output files to compile that aren't included at the end of any other source
MOC_OUT_PATH = $$absolute_path($$MOC_DIR, $$OUT_PWD)$${QMAKE_DIR_SEP}
-for (mocable_header, MOCABLE_HEADERS): GYPI_CONTENTS += " '$$MOC_OUT_PATH$$mocOutput($$mocable_header)',"
-for (mocable_source, MOCABLE_SOURCES): GYPI_CONTENTS += " '$$MOC_OUT_PATH$$mocOutput($$mocable_source)',"
+for (mocable_header, MOCABLE_HEADERS) {
+ !contains(INCLUDED_MOC_FILES, $$mocOutput($$mocable_header)) {
+ GYPI_CONTENTS += " '$$MOC_OUT_PATH$$mocOutput($$mocable_header)',"
+ }
+}
+
GYPI_CONTENTS += " ],"
!isEmpty(INCLUDEPATH) {
GYPI_CONTENTS += " 'include_dirs': ["
for (path, INCLUDEPATH): GYPI_CONTENTS += " '$$path',"
GYPI_CONTENTS += " ],"
}
+
# Generate the actions for moc
-!isEmpty(MOCABLE_HEADERS)|!isEmpty(MOCABLE_SOURCES) {
+!isEmpty(MOCABLE_HEADERS) {
GYPI_CONTENTS += " 'actions': ["
for(header, MOCABLE_HEADERS): GYPI_CONTENTS += $$mocAction($$header)
GYPI_CONTENTS += " ],"