summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2020-11-10 12:54:37 +0100
committerMaximilian Goldstein <max.goldstein@qt.io>2020-11-10 16:55:07 +0100
commit0bfb39da858606a837f38f3d406f041a3f3c179c (patch)
treec4d5e8614ef43d60347d231d26d20ca5a15c020b
parentba0895cf6973ca295eab4d922073105247cd749c (diff)
resources_function.prf: Discard external path prefixes
qtdeclarative's QtQml module adds a dynamically generated qmldir file to its RESOURCES which is located outside the source directory. Previously this caused qmake to generate an invalid alias for the qmldir file. Now the relative path is discarded properly. Fixes: QTBUG-88204 Change-Id: Ia689d9d110db092cee595bf44fcbb6d57783fded Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--mkspecs/features/resources_functions.prf6
1 files changed, 6 insertions, 0 deletions
diff --git a/mkspecs/features/resources_functions.prf b/mkspecs/features/resources_functions.prf
index 9b7c409121..7a260b471a 100644
--- a/mkspecs/features/resources_functions.prf
+++ b/mkspecs/features/resources_functions.prf
@@ -67,6 +67,12 @@ defineTest(qtFlattenResources) {
for (file, files) {
exists($$file/*): next() # exclude directories
alias = $$relative_path($$file, $$abs_base)
+
+ # If a resource is added by the build system from outside of $$_PRO_FILE_PWD_
+ # everything except the filename needs to be discarded.
+ subdir = $$find(alias, ^../)
+ if (!isEmpty(subdir)): alias = $$basename(file)
+
resource_file_content += \
"<file alias=\"$$xml_escape($$alias)\">$$xml_escape($$file)</file>"
OTHER_FILES *= $$file