aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlMacros.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-08-25 14:19:47 +1000
committerCraig Scott <craig.scott@qt.io>2021-08-30 11:25:11 +1000
commitd5611b288169961254a3a15b7a2416964e1b8781 (patch)
tree3be818f57ae1670ae40403e6f05d50e2bb089f8f /src/qml/Qt6QmlMacros.cmake
parent9e38f4da96ce294194c497e76b001298fe557f2d (diff)
Allow qt6_target_qml_sources() to be called with just resources
The argument checking was doing an early return if no QML_FILES were given, but there are use cases where one might want to pass RESOURCES and no QML_FILES. Change the early return logic to only return early if there are no .qml files and no resources. Now that we might have no .qml files, bypass preparing for qmlcachegen if no QML_FILES were given. This avoids a potential error if an invalid qmlcachegen property value would be encountered but it wouldn't have been needed to begin with. Pick-to: 6.2 Change-Id: Id197a541d4a5d1317ed14e56f0ac4d0d774b3568 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlMacros.cmake')
-rw-r--r--src/qml/Qt6QmlMacros.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index 3277322746..cf6cca0e38 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -1290,7 +1290,7 @@ function(qt6_target_qml_sources target)
message(FATAL_ERROR "Unknown/unexpected arguments: ${arg_UNPARSED_ARGUMENTS}")
endif()
- if (NOT arg_QML_FILES)
+ if (NOT arg_QML_FILES AND NOT arg_RESOURCES)
if(arg_OUTPUT_TARGETS)
set(${arg_OUTPUT_TARGETS} "" PARENT_SCOPE)
endif()
@@ -1360,7 +1360,7 @@ function(qt6_target_qml_sources target)
set(no_qmldir TRUE)
endif()
- if(NOT no_cachegen)
+ if(NOT no_cachegen AND arg_QML_FILES)
_qt_internal_genex_getproperty(types_file ${target} QT_QML_MODULE_PLUGIN_TYPES_FILE)
_qt_internal_genex_getproperty(qmlcachegen ${target} QT_QMLCACHEGEN_BINARY)
_qt_internal_genex_getproperty(direct_calls ${target} QT_QMLCACHEGEN_DIRECT_CALLS)