summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
authorOliver Wolff <oliver.wolff@qt.io>2020-04-24 13:52:32 +0200
committerOliver Wolff <oliver.wolff@qt.io>2020-04-28 20:04:42 +0200
commit85dab30b157babc5c59920ddc8a1710fb6d9efd1 (patch)
tree45c272ec58c5b3fe7cfd845d7554cc07d2064662 /mkspecs/features
parentbfde4f4a962ca56a7f2d7d63e788e79aa64cfb1f (diff)
Fix building of autotests for certain configurations
When a configuration is static and has builtin_testdata defined, it was possible that the "testdata" resource that is generated in testcase.prf was used for a qmlimportscan directly. This generated test data resource is no file though. It's a "qmake struct" that contains files and a base folder so that we should add every file from the "file list" of that struct. It is possible, that the generated resource has a base, but no files. Thus we need two loops or we can end up with a command line that ends with "-qmldir". If qmlimportscanner decided to warn/error out in this case in the future this feature could be broken and the point of breakage might not be obvious. Change-Id: I2111f594f7d5cf40521b8fe9236a8be9e2ed1b07 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/qt.prf21
1 files changed, 16 insertions, 5 deletions
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index fc46bcb74b..6fe0059bf7 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -279,11 +279,22 @@ contains(all_qt_module_deps, qml): \
for (QMLPATH, QMLPATHS): \
IMPORTPATHS += -importPath $$system_quote($$QMLPATH)
- # add qrc files, too
- !isEmpty(RESOURCES) {
- IMPORTPATHS += -qrcFiles
- for (RESOURCE, RESOURCES): \
- IMPORTPATHS += $$absolute_path($$system_quote($$RESOURCE), $$_PRO_FILE_PWD_)
+ # add resources to qmlimportscanner
+ for (RESOURCE, RESOURCES) {
+ defined($${RESOURCE}.files, var) {
+ # in case of a "struct", add the struct's files
+ base = $$RESOURCE.base
+ for (f, $$RESOURCE.files): SCANNERRESOURCES += "$$base/$$f"
+ } else {
+ # if the resource is a file, just add it
+ SCANNERRESOURCES += $$RESOURCE
+ }
+ }
+
+ !isEmpty(SCANNERRESOURCES) {
+ IMPORTPATHS += -qrcFiles
+ for (RESOURCE, SCANNERRESOURCES)
+ IMPORTPATHS += $$absolute_path($$system_quote($$RESOURCE), $$_PRO_FILE_PWD_)
}