Skip to content

Commit

Permalink
Don't run target executables during build when cross-compiling
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
arichardson committed Sep 3, 2023
1 parent 6529f5c commit c8ef343
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions external/microatf/cmake/ATFTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c8ef343

Please sign in to comment.