diff --git a/cmake/Tests.cmake b/cmake/Tests.cmake index bc427a39a..d345f1fa1 100644 --- a/cmake/Tests.cmake +++ b/cmake/Tests.cmake @@ -138,6 +138,9 @@ if(DEFINED ASAN) message(FATAL_ERROR "ASAN requires defining the CMake variable Rust_CARGO_TARGET to the intended target triple") endif() +endif() + +if(DEFINED Rust_CARGO_TARGET) list(APPEND cargo_test_flags "--target" ${Rust_CARGO_TARGET}) list(APPEND cargo_test_flags "--lib") endif()