diff --git a/CMakeLists.txt b/CMakeLists.txt index 92c479a..2e42756 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -380,11 +380,13 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND BUILD_TESTING) ${symbol_imports}) endif() - find_program(HARDENING_CHECK hardening-check) - if(HARDENING_CHECK) - add_test(NAME hardening_check - COMMAND ${HARDENING_CHECK} $ - --nofortify --nostackprotector) + if(NOT CMAKE_CROSSCOMPILING) + find_program(HARDENING_CHECK hardening-check) + if(HARDENING_CHECK) + add_test(NAME hardening_check + COMMAND ${HARDENING_CHECK} $ + --nofortify --nostackprotector) + endif() endif() # bench