summaryrefslogtreecommitdiffstats
path: root/build/qmake/mkspecs/features/gyp_generator.prf
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@digia.com>2013-07-18 19:56:26 +0200
committerZeno Albisser <zeno.albisser@digia.com>2013-07-19 17:12:35 +0200
commitc8c6be89630242f220263f3a0633dd493dec0ce6 (patch)
tree5baece511991882baf39a973158aee0937661403 /build/qmake/mkspecs/features/gyp_generator.prf
parenta95c6266282e17aa17642c6a03e234b067eb5599 (diff)
Fixing Qt Resource System Integration.
Add logic to functions.prf and gyp_generator.prf to invoke rcc from ninja as well. Since we are building the whole library with ninja, this is the only feasible way to get the dependencies right. Changine the TEMPLATE of resources.pro from subdirs to aux, since it is not building a library and not processing subdirectories either. Change-Id: I23dff04e488d839bb54e343588da98e5e9059b23 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'build/qmake/mkspecs/features/gyp_generator.prf')
-rw-r--r--build/qmake/mkspecs/features/gyp_generator.prf44
1 files changed, 34 insertions, 10 deletions
diff --git a/build/qmake/mkspecs/features/gyp_generator.prf b/build/qmake/mkspecs/features/gyp_generator.prf
index d40ee3c34..85dbd838c 100644
--- a/build/qmake/mkspecs/features/gyp_generator.prf
+++ b/build/qmake/mkspecs/features/gyp_generator.prf
@@ -4,6 +4,7 @@
load(functions)
load(moc)
+load(resources)
defineReplace(mocAction) {
INPUT_FILE = $$1
@@ -20,7 +21,7 @@ defineReplace(mocAction) {
" 'inputs': ['$$INPUT_FILE',]," \
" 'outputs': ['$$OUTPUT_FILE',]," \
" 'action': ["
-for(token, MOC_COMMAND): contents += " '$$token',"
+ for(token, MOC_COMMAND): contents += " '$$token',"
contents += " '$$INPUT_FILE'," \
" '-o'," \
" '$$OUTPUT_FILE'," \
@@ -30,6 +31,29 @@ for(token, MOC_COMMAND): contents += " '$$token',"
return($$contents)
}
+defineReplace(rccAction) {
+ INPUT_FILE = $$1
+ OUTPUT_NAME = $$rccOutput($$INPUT_FILE)
+ EXTERN_FUNC = $$rccExternFunc($$INPUT_FILE)
+ OUTPUT_FILE = $$absolute_path($$RCC_DIR, $$OUT_PWD)$${QMAKE_DIR_SEP}$${OUTPUT_NAME}
+ contents = " {" \
+ " 'action_name':'$$OUTPUT_NAME'," \
+ " 'inputs': ['$$INPUT_FILE',]," \
+ " 'outputs': ['$$OUTPUT_FILE',]," \
+ " 'action': [" \
+ " '$$QMAKE_RCC',"
+ for(resource_flag, $$QMAKE_RESOURCE_FLAGS): contents += " '$$resource_flag',"
+ contents += " '-name'," \
+ " '$$EXTERN_FUNC'," \
+ " '$$INPUT_FILE'," \
+ " '-o'," \
+ " '$$OUTPUT_FILE',"
+ contents += " ]," \
+ " },"
+
+ return($$contents)
+}
+
GYPI_FILE = $$replace(_PRO_FILE_, .pro$, .gyp)
TARGET_TYPE = $$toGypTargetType()
@@ -117,14 +141,15 @@ for (headerfile, HEADERS): GYP_CONTENTS += " '$$headerfile',"
for (resourcefile, RESOURCES) {
RCC_CPP = $$replace(resourcefile, .qrc, .cpp)
RCC_CPP = $$join(RCC_CPP, "qrc_", qrc_)
- GYP_CONTENTS += " '$$RCC_DIR/$$RCC_CPP',"
+ RCC_CPP = $$absolute_path($$RCC_DIR, $$OUT_PWD)$${QMAKE_DIR_SEP}$${RCC_CPP}
+ GYP_CONTENTS += " '$$RCC_CPP',"
}
# 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) {
!contains(INCLUDED_MOC_FILES, $$mocOutput($$mocable_header)) {
- GYP_CONTENTS += " '$$MOC_OUT_PATH$$mocOutput($$mocable_header)',"
+ GYP_CONTENTS += " '$$MOC_OUT_PATH$$mocOutput($$mocable_header)',"
}
}
@@ -136,13 +161,11 @@ GYP_CONTENTS += " ],"
}
# Generate the actions for moc
-!isEmpty(MOCABLE_HEADERS) {
- GYP_CONTENTS += " 'actions': ["
- for(header, MOCABLE_HEADERS): GYP_CONTENTS += $$mocAction($$header)
- GYP_CONTENTS += " ],"
-}
-
-GYP_CONTENTS += " }," \
+GYP_CONTENTS += " 'actions': ["
+for(resourcefile, RESOURCES): GYP_CONTENTS += $$rccAction($$resourcefile)
+for(header, MOCABLE_HEADERS): GYP_CONTENTS += $$mocAction($$header)
+GYP_CONTENTS += " ]," \
+ " }," \
" ]," \
"}"
@@ -155,3 +178,4 @@ unix: phony_variable_name_for_qmake_to_be_happy=$$system("touch $$QTWEBENGINE_RO
TEMPLATE = aux
SOURCES =
HEADERS =
+RESOURCES =