[tesseract] fix unrecognized command line option -mfpu=neon on aarch64 (#32507)

This commit is contained in:
hesmar 2023-07-11 21:22:54 +02:00 committed by GitHub
parent 92bad87dfb
commit e5f4e66fed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,25 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index db4c39d5..276c65f3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -257,7 +257,11 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*")
set(HAVE_AVX512F FALSE)
set(HAVE_FMA FALSE)
set(HAVE_SSE4_1 FALSE)
+
check_cxx_compiler_flag("-mfpu=neon" HAVE_NEON)
+ if(HAVE_NEON)
+ set(NEON_COMPILE_FLAGS "-mfpu=neon")
+ endif(HAVE_NEON)
else()
@@ -271,7 +275,6 @@ else()
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86|x86_64|AMD64|amd64|i386|i686")
if(HAVE_NEON)
- set(NEON_COMPILE_FLAGS "-mfpu=neon")
message(STATUS "LTO build is not supported on arm/RBPi.")
set(ENABLE_LTO FALSE) # enable LTO cause fatal error on arm/RBPi
endif()

View File

@ -10,6 +10,7 @@ vcpkg_from_github(
PATCHES
${tesseract_patch}
fix_static_link_icu.patch
fix-aarch64-mfpu-not-available.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS

View File

@ -1,6 +1,7 @@
{
"name": "tesseract",
"version": "5.3.1",
"port-version": 1,
"description": "An OCR Engine that was developed at HP Labs between 1985 and 1995... and now at Google.",
"homepage": "https://github.com/tesseract-ocr/tesseract",
"license": "Apache-2.0",

View File

@ -7994,7 +7994,7 @@
},
"tesseract": {
"baseline": "5.3.1",
"port-version": 0
"port-version": 1
},
"tfhe": {
"baseline": "1.0.1",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d0b39327eee123cac1611afe9d88303822fedbdf",
"version": "5.3.1",
"port-version": 1
},
{
"git-tree": "aeb035e40f678090353d237cc6de1089fb58d89c",
"version": "5.3.1",