diff --git a/3rdparty/libpng/CMakeLists.txt b/3rdparty/libpng/CMakeLists.txt index 1b2dddd0d7..88bf04d604 100644 --- a/3rdparty/libpng/CMakeLists.txt +++ b/3rdparty/libpng/CMakeLists.txt @@ -14,7 +14,7 @@ ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}" ${ZLIB_INCLUDE_DIR}) file(GLOB lib_srcs *.c) file(GLOB lib_hdrs *.h) -if(NEON AND CMAKE_SIZEOF_VOID_P EQUAL 4) +if(ARM AND NEON) list(APPEND lib_srcs arm/filter_neon.S) add_definitions(-DPNG_ARM_NEON) endif() diff --git a/3rdparty/tbb/CMakeLists.txt b/3rdparty/tbb/CMakeLists.txt index f5c67fb172..1fd31fa476 100644 --- a/3rdparty/tbb/CMakeLists.txt +++ b/3rdparty/tbb/CMakeLists.txt @@ -204,7 +204,7 @@ endif() set(TBB_SOURCE_FILES ${lib_srcs} ${lib_hdrs}) -if (ARM AND NOT WIN32) +if ((ARM OR AARCH64) AND NOT WIN32) if (NOT ANDROID) set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/arm_linux_stub.cpp") endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 268c3cc009..b10f2cc5d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -226,8 +226,8 @@ OCV_OPTION(ENABLE_SSE41 "Enable SSE4.1 instructions" 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_AVX2 "Enable AVX2 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" AARCH64 IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64)) +OCV_OPTION(ENABLE_VFPV3 "Enable VFPv3-D32 instructions" AARCH64 IF CMAKE_COMPILER_IS_GNUCXX AND (ARM OR AARCH64)) 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/cmake/OpenCVDetectCUDA.cmake b/cmake/OpenCVDetectCUDA.cmake index 24fbb03ce3..99e434951e 100644 --- a/cmake/OpenCVDetectCUDA.cmake +++ b/cmake/OpenCVDetectCUDA.cmake @@ -91,8 +91,13 @@ if(CUDA_FOUND) if(NOT DEFINED __cuda_arch_bin) if(ANDROID) - set(__cuda_arch_bin "3.2") - set(__cuda_arch_ptx "") + if (ARM) + set(__cuda_arch_bin "3.2") + set(__cuda_arch_ptx "") + elseif(AARCH64) + set(__cuda_arch_bin "5.2") + set(__cuda_arch_ptx "") + endif() else() if(${CUDA_VERSION} VERSION_LESS "5.0") set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0") @@ -154,7 +159,10 @@ if(CUDA_FOUND) if(ANDROID) set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xptxas;-dlcm=ca") - set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-target-os-variant=Android") + if(${CUDA_VERSION} VERSION_LESS "7.0") + # since CUDA 7.0 OS variant is depricated + set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-target-os-variant=Android") + endif() endif() message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}") diff --git a/cmake/OpenCVDetectCXXCompiler.cmake b/cmake/OpenCVDetectCXXCompiler.cmake index 819c2e0c5a..674a6e4a82 100644 --- a/cmake/OpenCVDetectCXXCompiler.cmake +++ b/cmake/OpenCVDetectCXXCompiler.cmake @@ -109,6 +109,8 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i686.*|i386.*|x86.*|amd64.*|AMD64.*") set(X86 1) elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "arm.*|ARM.*") set(ARM 1) +elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64.*|AARCH64.*") + set(AARCH64 1) endif()