From 69c82b4c2be3467f98a6e306ce242ed8037ee3c2 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Mon, 13 Oct 2014 22:34:15 +0400 Subject: [PATCH] ability to compile for iOS with Neon --- CMakeLists.txt | 4 ++-- platforms/ios/build_framework.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5301f82..03625db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,8 +215,8 @@ OCV_OPTION(ENABLE_SSSE3 "Enable SSSE3 instructions" OCV_OPTION(ENABLE_SSE41 "Enable SSE4.1 instructions" OFF IF ((CV_ICC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) ) OCV_OPTION(ENABLE_SSE42 "Enable SSE4.2 instructions" OFF IF (CMAKE_COMPILER_IS_GNUCXX AND (X86 OR X86_64)) ) OCV_OPTION(ENABLE_AVX "Enable AVX instructions" OFF IF ((MSVC OR CMAKE_COMPILER_IS_GNUCXX) AND (X86 OR X86_64)) ) -OCV_OPTION(ENABLE_NEON "Enable NEON instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND ARM ) -OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND ARM ) +OCV_OPTION(ENABLE_NEON "Enable NEON instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR IOS) ) +OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" OFF IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR IOS) ) OCV_OPTION(ENABLE_NOISY_WARNINGS "Show all warnings even if they are too noisy" OFF ) OCV_OPTION(OPENCV_WARNINGS_ARE_ERRORS "Treat warnings as errors" OFF ) OCV_OPTION(ENABLE_WINRT_MODE "Build with Windows Runtime support" OFF IF WIN32 ) diff --git a/platforms/ios/build_framework.py b/platforms/ios/build_framework.py index 4d4f7e3..8b21982 100755 --- a/platforms/ios/build_framework.py +++ b/platforms/ios/build_framework.py @@ -42,6 +42,10 @@ def build_opencv(srcroot, buildroot, target, arch): "-DBUILD_opencv_world=ON " + "-DCMAKE_C_FLAGS=\"-Wno-implicit-function-declaration\" " + "-DCMAKE_INSTALL_PREFIX=install") % (srcroot, target) + + if arch.startswith("armv"): + cmakeargs += " -DENABLE_NEON=ON" + # if cmake cache exists, just rerun cmake to update OpenCV.xproj if necessary if os.path.isfile(os.path.join(builddir, "CMakeCache.txt")): os.system("cmake %s ." % (cmakeargs,)) -- 2.7.4