mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-27 12:49:35 +08:00
cmake: Activate NEON support for ARM64
Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
parent
a06d961212
commit
5d040f91a0
@ -164,6 +164,24 @@ if(COMPILER_SUPPORTS_MARCH_NATIVE)
|
||||
set(MARCH_NATIVE_OPT ON)
|
||||
endif()
|
||||
|
||||
# Flags for SIMD support
|
||||
set(HAVE_AVX FALSE)
|
||||
set(HAVE_AVX2 FALSE)
|
||||
set(HAVE_FMA FALSE)
|
||||
set(HAVE_SSE4_1 FALSE)
|
||||
set(HAVE_NEON FALSE)
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "arm64|aarch64.*|AARCH64.*")
|
||||
set(AARCH64 TRUE)
|
||||
endif()
|
||||
|
||||
if(AARCH64)
|
||||
|
||||
add_definitions("-DHAVE_NEON")
|
||||
set(HAVE_NEON TRUE)
|
||||
|
||||
else()
|
||||
|
||||
CHECK_CXX_COMPILER_FLAG("-mavx" HAVE_AVX)
|
||||
if(HAVE_AVX)
|
||||
set(AVX_COMPILE_FLAGS "-mavx")
|
||||
@ -220,6 +238,8 @@ if(MSVC)
|
||||
endif()
|
||||
endif(MSVC)
|
||||
|
||||
endif(AARCH64)
|
||||
|
||||
# auto optimize - used only for information about available vectors
|
||||
include(OptimizeForArchitecture)
|
||||
OptimizeForArchitecture()
|
||||
|
Loading…
Reference in New Issue
Block a user