From 94a480282481e98ce5402b872b911f0e056c234e Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Mon, 11 Nov 2024 16:56:28 -0800 Subject: [PATCH] Don't do hardening check if cross compiling --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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