Fix calls to qtFlattenResources from outside resources.prf
The xml_escape function must be part of resources_functions.prf, and the
qmake_immediate resource must not be created multiple times. Instead,
create another qmake_immediate resource with a number suffix.
This commit amends 577b6554
.
Task-number: QTBUG-79672
Change-Id: Ibbe20c0fd1940f1fe7733cd1e5b0891f65689782
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This commit is contained in:
parent
42aa740df7
commit
c5777ad81c
@ -6,16 +6,6 @@ isEmpty(QMAKE_MOD_RCC):QMAKE_MOD_RCC = qrc
|
||||
!contains(QMAKE_RESOURCE_FLAGS, -root):!isEmpty(QMAKE_RESOURCE_ROOT):QMAKE_RESOURCE_FLAGS += -root $$QMAKE_RESOURCE_ROOT
|
||||
!contains(QMAKE_RESOURCE_FLAGS, -name): QMAKE_RESOURCE_FLAGS += -name ${QMAKE_FILE_BASE}
|
||||
|
||||
# http://www.w3.org/TR/xml/#syntax
|
||||
defineReplace(xml_escape) {
|
||||
1 ~= s,&,&,
|
||||
1 ~= s,\',',
|
||||
1 ~= s,\",",
|
||||
1 ~= s,<,<,
|
||||
1 ~= s,>,>,
|
||||
return($$1)
|
||||
}
|
||||
|
||||
load(resources_functions)
|
||||
qtFlattenResources()
|
||||
|
||||
|
@ -1,5 +1,21 @@
|
||||
# http://www.w3.org/TR/xml/#syntax
|
||||
defineReplace(xml_escape) {
|
||||
1 ~= s,&,&,
|
||||
1 ~= s,\',',
|
||||
1 ~= s,\",",
|
||||
1 ~= s,<,<,
|
||||
1 ~= s,>,>,
|
||||
return($$1)
|
||||
}
|
||||
|
||||
defineTest(qtFlattenResources) {
|
||||
RESOURCES += qmake_immediate
|
||||
immediate = qmake_immediate$$QMAKE_RESOURCES_IMMEDIATE_NR
|
||||
defined(QMAKE_RESOURCES_IMMEDIATE_NR, var): \
|
||||
QMAKE_RESOURCES_IMMEDIATE_NR = $$num_add($$QMAKE_RESOURCES_IMMEDIATE_NR, 1)
|
||||
else: \
|
||||
QMAKE_RESOURCES_IMMEDIATE_NR = 1
|
||||
|
||||
RESOURCES += $$immediate
|
||||
for(resource, RESOURCES) {
|
||||
# Regular case of user qrc file
|
||||
contains(resource, ".*\\.qrc$"): \
|
||||
@ -7,10 +23,10 @@ defineTest(qtFlattenResources) {
|
||||
|
||||
# Fallback for stand-alone files/directories
|
||||
!defined($${resource}.files, var) {
|
||||
!equals(resource, qmake_immediate) {
|
||||
!equals(resource, $$immediate) {
|
||||
!exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \
|
||||
warning("Failure to find: $$resource")
|
||||
qmake_immediate.files += $$resource
|
||||
$${immediate}.files += $$resource
|
||||
OTHER_FILES *= $$resource
|
||||
}
|
||||
RESOURCES -= $$resource
|
||||
@ -56,8 +72,9 @@ defineTest(qtFlattenResources) {
|
||||
RESOURCES -= $$resource
|
||||
RESOURCES += $$resource_file
|
||||
}
|
||||
export(QMAKE_RESOURCES_IMMEDIATE_NR)
|
||||
export(RESOURCES)
|
||||
export(OTHER_FILES)
|
||||
export(qmake_immediate.files)
|
||||
export($${immediate}.files)
|
||||
return(true)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user