diff --git a/cmake/DetectArchitecture.cmake b/cmake/DetectArchitecture.cmake index ed8698e264..c17e89b9c6 100644 --- a/cmake/DetectArchitecture.cmake +++ b/cmake/DetectArchitecture.cmake @@ -42,19 +42,21 @@ set(CMAKE_REQUIRED_FLAGS_SAVE "${CMAKE_REQUIRED_FLAGS}") set(AVX_NAME "T_fallback") if ((${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64") OR (${CMAKE_SYSTEM_PROCESSOR} MATCHES "i386") OR (${CMAKE_SYSTEM_PROCESSOR} MATCHES "AMD64")) -foreach(INSTRUCTION_SET IN LISTS INSTRUCTION_SETS) - string(REPLACE "?" ";" CURRENT_LIST "${INSTRUCTION_SET}") - list(GET CURRENT_LIST 0 INSTRUCTION_SET_NAME) - list(GET CURRENT_LIST 1 INSTRUCTION_SET_FLAG) - string(REPLACE "." ";" INSTRUCTION_SET_FLAG "${INSTRUCTION_SET_FLAG}") - list(GET CURRENT_LIST 2 INSTRUCTION_SET_INTRINSIC) - string(REPLACE "#" ";" INSTRUCTION_SET_INTRINSIC "${INSTRUCTION_SET_INTRINSIC}") - check_instruction_set("${INSTRUCTION_SET_NAME}" "${INSTRUCTION_SET_FLAG}" "${INSTRUCTION_SET_INTRINSIC}") -endforeach() + foreach(INSTRUCTION_SET IN LISTS INSTRUCTION_SETS) + string(REPLACE "?" ";" CURRENT_LIST "${INSTRUCTION_SET}") + list(GET CURRENT_LIST 0 INSTRUCTION_SET_NAME) + list(GET CURRENT_LIST 1 INSTRUCTION_SET_FLAG) + string(REPLACE "." ";" INSTRUCTION_SET_FLAG "${INSTRUCTION_SET_FLAG}") + list(GET CURRENT_LIST 2 INSTRUCTION_SET_INTRINSIC) + string(REPLACE "#" ";" INSTRUCTION_SET_INTRINSIC "${INSTRUCTION_SET_INTRINSIC}") + check_instruction_set("${INSTRUCTION_SET_NAME}" "${INSTRUCTION_SET_FLAG}" "${INSTRUCTION_SET_INTRINSIC}") + endforeach() string(REPLACE "T_" "" AVX_DISPLAY ${AVX_NAME}) message(STATUS "Detected ${CMAKE_SYSTEM_PROCESSOR} SSE type: ${AVX_DISPLAY}") set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_SAVE}") else() message(STATUS "SSE not supported by architecture ${CMAKE_SYSTEM_PROCESSOR} ${AVX_NAME}") + set(AVX_NAME "T_fallback") + set(AVX_TYPE "T_fallback") endif()