diff --git a/CMakeLists.txt b/CMakeLists.txt index b4530e7..756f505 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,9 +26,7 @@ endif() # Check CPU requirements include(cmake/ZREDetectSSE42.cmake) -message(STATUS "SUPPORTS_SSE4.2 = ${SUPPORTS_SSE42}") include(cmake/ZREDetectNEON.cmake) -message(STATUS "SUPPORTS_NEON = ${SUPPORTS_NEON}") if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64" AND NOT SUPPORTS_AVX) message(FATAL_ERROR "FATAL: A CPU supporting SSE4.2 is required.") diff --git a/cmake/ZREDetectNEON.cmake b/cmake/ZREDetectNEON.cmake index 56a1c1a..7e6de46 100644 --- a/cmake/ZREDetectNEON.cmake +++ b/cmake/ZREDetectNEON.cmake @@ -1,4 +1,8 @@ -try_compile(SUPPORTS_NEON - "${CMAKE_BINARY_DIR}" - "${CMAKE_SOURCE_DIR}/cmake/checks/cpu_neon.cpp" -) \ No newline at end of file +if(NOT DEFINED SUPPORTS_NEON) + try_compile(SUPPORTS_NEON + "${CMAKE_BINARY_DIR}" + "${CMAKE_SOURCE_DIR}/cmake/checks/cpu_neon.cpp" + ) +endif() + +message(STATUS "SUPPORTS NEON: ${SUPPORTS_NEON}") diff --git a/cmake/ZREDetectSSE42.cmake b/cmake/ZREDetectSSE42.cmake index ab96e95..8e8ba73 100644 --- a/cmake/ZREDetectSSE42.cmake +++ b/cmake/ZREDetectSSE42.cmake @@ -1,4 +1,8 @@ -try_compile(SUPPORTS_SSE42 - "${CMAKE_BINARY_DIR}" - "${CMAKE_SOURCE_DIR}/cmake/checks/cpu_sse42.cpp" -) \ No newline at end of file +if(NOT DEFINED SUPPORTS_SSE42) + try_compile(SUPPORTS_SSE42 + "${CMAKE_BINARY_DIR}" + "${CMAKE_SOURCE_DIR}/cmake/checks/cpu_sse42.cpp" + ) +endif() + +message(STATUS "SUPPORTS SSE4.2 = ${SUPPORTS_SSE42}")