From 3039ff1390f2098dd58bb6c033f83b015315fc1f Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sat, 11 Mar 2023 12:42:56 +0000 Subject: [PATCH] Don't discover tests when cross-compiling w/o an emulator (#5197) --- tests/libtransmission/CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/libtransmission/CMakeLists.txt b/tests/libtransmission/CMakeLists.txt index 758f0ddb9..92abf3779 100644 --- a/tests/libtransmission/CMakeLists.txt +++ b/tests/libtransmission/CMakeLists.txt @@ -77,9 +77,14 @@ target_link_libraries(libtransmission-test libevent::event WideInteger::WideInteger) -gtest_discover_tests(libtransmission-test - TEST_PREFIX "LT." -) +if(NOT CMAKE_CROSSCOMPILING OR CMAKE_CROSSCOMPILING_EMULATOR) + gtest_discover_tests(libtransmission-test + TEST_PREFIX "LT.") +else() + add_test( + NAME libtransmission-test + COMMAND libtransmission-test) +endif() add_custom_command( TARGET libtransmission-test