flac/cmake/CheckA64NEON.cmake

15 lines
711 B
CMake

macro(CHECK_A64NEON VARIABLE)
if(NOT DEFINED HAVE_${VARIABLE})
message(STATUS "Check whether A64 NEON can be used")
configure_file(${PROJECT_SOURCE_DIR}/cmake/CheckA64NEON.c.in ${PROJECT_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckA64NEON.c @ONLY)
try_compile(HAVE_${VARIABLE} "${PROJECT_BINARY_DIR}"
"${PROJECT_BINARY_DIR}/CMakeFiles/CMakeTmp/CheckA64NEON.c")
if(HAVE_${VARIABLE})
message(STATUS "Check whether A64 NEON can be used - yes")
set(${VARIABLE} 1 CACHE INTERNAL "Result of CHECK_A64NEON" FORCE)
else ()
message(STATUS "Check whether A64 NEON can be used - no")
endif()
endif ()
endmacro(CHECK_A64NEON)