cmake build: Set the WITH_TESTS macro also in the tests themselves

Otherwise plugin and test code might parse header files differently.

Change-Id: I0243a7780b7095a4c518da26cc3cf23fd9f76cf5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Christian Kandeler
2023-08-31 13:37:04 +02:00
parent 925b7a3566
commit fb4177a540

View File

@@ -850,7 +850,7 @@ function(add_qtc_test name)
endif()
endforeach()
set(TEST_DEFINES SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
set(TEST_DEFINES WITH_TESTS SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
# relax cast requirements for tests
get_default_defines(default_defines_copy YES)