From c107525edb7f681db4748ae4a1087423f18ec10a Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Thu, 5 Jan 2023 15:26:21 +0100 Subject: [PATCH] Only add defines for sources in batched target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When encountering a batchable target, only add its defines to the sources that the target contains. Otherwise, the defines interfere with other tests in the batch. Fixes: QTBUG-109848 Change-Id: I35d1665d29bb0ce93b82059f7f3b715070539d21 Reviewed-by: Jörg Bornemann --- cmake/QtTestHelpers.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index fbda0f5ce29..79c5b5b5d0a 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -352,8 +352,6 @@ function(qt_internal_add_test_to_batch batch_name name) PUBLIC_LIBRARIES ${arg_PUBLIC_LIBRARIES} LIBRARIES ${arg_LIBRARIES} SOURCES ${arg_SOURCES} - DEFINES - ${arg_DEFINES} COMPILE_OPTIONS ${arg_COMPILE_OPTIONS} COMPILE_FLAGS ${arg_COMPILE_FLAGS} LINK_OPTIONS ${arg_LINK_OPTIONS} @@ -368,7 +366,7 @@ function(qt_internal_add_test_to_batch batch_name name) set_source_files_properties(${source} TARGET_DIRECTORY ${target} PROPERTIES COMPILE_DEFINITIONS - "BATCHED_TEST_NAME=\"${name}\"") + "BATCHED_TEST_NAME=\"${name}\";${arg_DEFINES}" ) endforeach() set(${batch_name} ${target} PARENT_SCOPE)