From 7f939de9d785ad7aa67b7e8a93c03adad50ce140 Mon Sep 17 00:00:00 2001 From: Jack Gallagher Date: Wed, 16 Aug 2023 12:14:43 +0000 Subject: [PATCH] Try to fix AArch64 cross compile --- CMakeLists.txt | 2 +- make/utils.cmake | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 51943fe7156..78ca9114aad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -624,7 +624,7 @@ endif () set(proc_supports_sve OFF) if (AARCH64 AND UNIX) set(CFLAGS_SVE "-march=armv8-a+sve") - check_sve_processor_and_compiler_support(proc_supports_sve) + check_sve_compiler_support(proc_supports_sve) endif () # Ensure that _AMD64_ or _X86_ are defined on Microsoft Windows, as otherwise diff --git a/make/utils.cmake b/make/utils.cmake index 373c04d3cca..168846d43a6 100644 --- a/make/utils.cmake +++ b/make/utils.cmake @@ -314,8 +314,8 @@ if (UNIX) endif (UNIX) -function (check_sve_processor_and_compiler_support out) - include(CheckCSourceRuns) +function (check_sve_compiler_support out) + include(CheckCSourceCompiles) set(sve_prog "#include int main() { uint64_t vl = 0; @@ -324,12 +324,11 @@ function (check_sve_processor_and_compiler_support out) return 0; }") set(CMAKE_REQUIRED_FLAGS ${CFLAGS_SVE}) - check_c_source_runs("${sve_prog}" proc_found_sve) + check_c_source_compiles("${sve_prog}" proc_found_sve) if (proc_found_sve) - message(STATUS "Compiler and processor support SVE.") + message(STATUS "Compiler supports SVE.") else () - message(STATUS "WARNING: Compiler or processor do not support SVE. " - "Skipping tests") + message(STATUS "WARNING: Compiler does not support SVE. Skipping tests") endif () set(${out} ${proc_found_sve} PARENT_SCOPE) -endfunction (check_sve_processor_and_compiler_support) +endfunction (check_sve_compiler_support)