Skip to content

Commit

Permalink
Try to fix AArch64 cross compile
Browse files Browse the repository at this point in the history
  • Loading branch information
jackgallagher-arm committed Aug 16, 2023
1 parent ab5128c commit 7f939de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions make/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdint.h>
int main() {
uint64_t vl = 0;
Expand All @@ -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)

0 comments on commit 7f939de

Please sign in to comment.