8c46644a8d
Add checks for POWER8/9 intrinsics similar to those in autotools to cmake
15 lines
672 B
CMake
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)
|