From c8ef3435af67b78968c0b9f222dd9dbb57459ab4 Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Sun, 19 Jun 2022 13:38:08 +0000 Subject: [PATCH] Don't run target executables during build when cross-compiling Trying to run the test executables during the build to get the list of test cases causes my cross-compilation to fail. Skip adding the test cases to CTest in that case (but still build them we can run them manually). --- external/microatf/cmake/ATFTest.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/external/microatf/cmake/ATFTest.cmake b/external/microatf/cmake/ATFTest.cmake index 75905da..88b5bcd 100644 --- a/external/microatf/cmake/ATFTest.cmake +++ b/external/microatf/cmake/ATFTest.cmake @@ -16,6 +16,11 @@ function(atf_discover_tests _target) TARGET "${_target}" PROPERTY CROSSCOMPILING_EMULATOR) + if(CMAKE_CROSSCOMPILING AND NOT _test_executor) + message(WARNING "Cannot detect tests for ${_target} without CROSSCOMPILING_EMULATOR") + return() + endif() + add_custom_command( TARGET ${_target} POST_BUILD