diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-01-05 15:26:21 +0100 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-01-06 17:42:45 +0100 |
commit | c107525edb7f681db4748ae4a1087423f18ec10a (patch) | |
tree | b4d970588a6d8c0df65af42eb47ffaccaea02bae /cmake/QtTestHelpers.cmake | |
parent | daba0b8c19284fb68493cb8350804277b94b79ba (diff) |
Only add defines for sources in batched target
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 <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtTestHelpers.cmake')
-rw-r--r-- | cmake/QtTestHelpers.cmake | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index fbda0f5ce2..79c5b5b5d0 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) |