cmake_minimum_required(VERSION 3.12)

if(IOS AND CMAKE_OSX_ARCHITECTURES MATCHES "arm")
    option(MAPNN_BUILD_WITH_NEON "" ON)
elseif(IOS AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
    option(MAPNN_BUILD_WITH_ASIMD "" ON)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(X86_64)|(x64)|(X64)|(amd64)|(AMD64)|(i686)")
    message(STATUS "mapnn build with sse42")
    option(MAPNN_BUILD_WITH_SSE42 "" ON)
    add_definitions(-DMAPNN_USE_SSE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^armv7")
    message(STATUS "mapnn build with neon")
    option(MAPNN_BUILD_WITH_NEON "" ON)
    add_definitions(-DMAPNN_USE_NEON32)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
    message(STATUS "mapnn build with asimd")
    option(MAPNN_BUILD_WITH_ASIMD "" ON)
    add_definitions(-DMAPNN_USE_NEON64)
else()
    message(STATUS "mapnn build with none")
endif()
