flac/cmake/CheckVSX.cmake
Martijn van Beurden 8c46644a8d [CMake] Add check for PPC64, POWER8/9 and vec_doubleh
Add checks for POWER8/9 intrinsics similar to those in autotools
to cmake
2022-04-25 20:13:36 +02:00

15 lines
672 B
CMake

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