aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-08-31 16:15:53 +1000
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-01 17:34:38 +0000
commit18708963a5dd93c5204b9f73f0d3fae5014d600d (patch)
tree19412c1c32fe93c1a0af5e0a6c89505bdedb6c1f /src
parent8b4d90e5ea24a9070ecef54395a503cdaee4d278 (diff)
Ensure versionless wrappers do not introduce a new variable scope
Using function instead of macro prevented the wrappers from being able to pass back any variables set by the wrapped function in the calling scope. Prefer macros to avoid silently swallowing such variable setting. Task-number: QTBUG-96121 Change-Id: Ia0695fbf65375cc9541612736e34e873c0230832 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit fdc1e18f8b829efd1f57dc8514d2b0a0ccb7f447) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/qml/Qt6QmlMacros.cmake16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index 83d7393335..c1f02fbc56 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -603,9 +603,9 @@ function(qt6_add_qml_module target)
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
- function(qt_add_qml_module)
+ macro(qt_add_qml_module)
qt6_add_qml_module(${ARGV})
- endfunction()
+ endmacro()
endif()
function(_qt_internal_get_escaped_uri uri out_var)
@@ -1198,9 +1198,9 @@ function(qt6_add_qml_plugin target)
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
- function(qt_add_qml_plugin)
+ macro(qt_add_qml_plugin)
qt6_add_qml_plugin(${ARGV})
- endfunction()
+ endmacro()
endif()
@@ -1586,9 +1586,9 @@ function(qt6_target_qml_sources target)
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
- function(qt_target_qml_sources)
+ macro(qt_target_qml_sources)
qt6_target_qml_sources(${ARGV})
- endfunction()
+ endmacro()
endif()
# target: Expected to be the backing target for a qml module. Certain target
@@ -2031,13 +2031,13 @@ but this file does not exist. Possible reasons include:
endfunction()
if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
- function(qt_import_qml_plugins)
+ macro(qt_import_qml_plugins)
if(QT_DEFAULT_MAJOR_VERSION EQUAL 5)
qt5_import_qml_plugins(${ARGV})
elseif(QT_DEFAULT_MAJOR_VERSION EQUAL 6)
qt6_import_qml_plugins(${ARGV})
endif()
- endfunction()
+ endmacro()
endif()
function(_qt_internal_add_static_qml_plugin_dependencies plugin_target backing_target)