cmake: Fix bug not enabling test wrapper for running minimal tests when cross compiling

The test wrapper needs to be enabled for running any test when cross compiling.
This commit is contained in:
Ralf Habacker 2025-03-15 13:33:05 +01:00
parent bdfef3916f
commit b8292da025

View file

@ -1,6 +1,6 @@
option(DBUS_USE_WINE "set to 1 or ON to support running test cases with Wine" OFF)
if((DBUS_ENABLE_MODULAR_TESTS OR DBUS_ENABLE_INTRUSIVE_TESTS) AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows")
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
find_file(WINE_EXECUTABLE
NAMES wine
@ -35,6 +35,7 @@ if((DBUS_ENABLE_MODULAR_TESTS OR DBUS_ENABLE_INTRUSIVE_TESTS) AND CMAKE_CROSSCOM
set(Z_DRIVE_IF_WINE "z:")
if(DBUS_USE_WINE AND WINE_EXECUTABLE)
set(TEST_WRAPPER "${WINE_EXECUTABLE}")
message(STATUS "Using wrapper for running tests: ${TEST_WRAPPER}")
endif()
endif()