summaryrefslogtreecommitdiffstats
path: root/cmake/QtTestHelpers.cmake
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-01-22 14:06:49 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2022-01-31 17:40:43 +0100
commit1d28fd7a9c4720289f3d41db2ed8e6fcb07d5a30 (patch)
tree0be203a249dbd46f2a518f2ded82a7a5950d81c1 /cmake/QtTestHelpers.cmake
parentf2f5c7d2b71a93ff826e3731cbb80febe5c7b308 (diff)
Restore missing Qt definitions
Restore the 'QT_NO_JAVA_STYLE_ITERATORS' and 'QT_NO_NARROWING_CONVERSIONS_IN_CONNECT' definitions for Qt targets. Add the function that adds global definitions for Qt targets according to the provided scope and the target property-based switch to disable the definition for a specific target. Pick-to: 6.2 6.3 Task-number: QTBUG-100295 Change-Id: I28697e81f9aabc45c48d79aae1e5caea141e04e1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtTestHelpers.cmake')
-rw-r--r--cmake/QtTestHelpers.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake
index 6c9ecba069..79e69f231b 100644
--- a/cmake/QtTestHelpers.cmake
+++ b/cmake/QtTestHelpers.cmake
@@ -33,6 +33,10 @@ function(qt_internal_add_benchmark target)
${exec_args}
)
+ # Disable the QT_NO_NARROWING_CONVERSIONS_IN_CONNECT define for benchmarks
+ set_target_properties(${target} PROPERTIES
+ QT_INTERNAL_UNDEF_QT_NO_NARROWING_CONVERSIONS_IN_CONNECT TRUE)
+
qt_internal_collect_command_environment(benchmark_env_path benchmark_env_plugin_path)
# Add a ${target}_benchmark generator target, to run single benchmark more easily.
@@ -92,6 +96,10 @@ function(qt_internal_add_manual_test target)
${exec_args}
)
+ # Disable the QT_NO_NARROWING_CONVERSIONS_IN_CONNECT define for manual tests
+ set_target_properties(${target} PROPERTIES
+ QT_INTERNAL_UNDEF_QT_NO_NARROWING_CONVERSIONS_IN_CONNECT TRUE)
+
endfunction()
# This function will configure the fixture for the network tests that require docker network services
@@ -231,6 +239,10 @@ function(qt_internal_add_test name)
DISABLE_AUTOGEN_TOOLS ${arg_DISABLE_AUTOGEN_TOOLS}
)
+ # Disable the QT_NO_NARROWING_CONVERSIONS_IN_CONNECT define for tests
+ set_target_properties(${name} PROPERTIES
+ QT_INTERNAL_UNDEF_QT_NO_NARROWING_CONVERSIONS_IN_CONNECT TRUE)
+
# Tests should not be bundles on macOS even if arg_GUI is true, because some tests make
# assumptions about the location of helper processes, and those paths would be different
# if a test is built as a bundle.
@@ -617,6 +629,11 @@ function(qt_internal_add_test_helper name)
endif()
qt_internal_add_executable("${name}" NO_INSTALL ${extra_args_to_pass} ${forward_args})
+
+ # Disable the QT_NO_NARROWING_CONVERSIONS_IN_CONNECT define for test helpers
+ set_target_properties(${name} PROPERTIES
+ QT_INTERNAL_UNDEF_QT_NO_NARROWING_CONVERSIONS_IN_CONNECT TRUE)
+
endfunction()
function(qt_internal_wrap_command_arguments argument_list)