Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xiph/opus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathaniel R. Lewis <linux.robotdude@gmail.com>2020-04-09 21:43:09 +0300
committerJean-Marc Valin <jmvalin@jmvalin.ca>2020-04-21 05:47:56 +0300
commit7628d844b4a0435c676fbe9ef03b3c2f8bf3eb5f (patch)
tree76e94b095535e7a804e2f01d921a358d8c610c2f
parent4fc7d874969da418d81b6e0d44b41759c19836aa (diff)
CMake Changes
- Fix typo in OPUS_USE_NEON description. - Set OPUS_PRESUME_NEON for iOS platforms as all armv7 and higher iOS devices support NEON. - Fix detection of aarch64 for OPUS_CPU_ARM and adding sources from celt_sources_arm. (previously would miss armcpu.c and arm_celt_map.c) - Change "armv7-a" to "arm" in MATCHES checks against CMAKE_SYSTEM_PROCESSOR as systems like the RPi3 report as "armv7l". - Rename OPUS_MAY_SUPPORT_NEON to OPUS_MAY_HAVE_NEON as this name is used everywhere else in the CMake build system. Without this, runtime capability detection is broken on aarch64. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
-rw-r--r--CMakeLists.txt2
-rw-r--r--opus_config.cmake8
-rw-r--r--opus_functions.cmake8
3 files changed, 13 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed7870e9..ae422c78 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -353,7 +353,7 @@ if(MSVC)
endif()
endif()
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "(armv7-a)")
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm|aarch64)")
add_sources_group(opus celt ${celt_sources_arm})
endif()
diff --git a/opus_config.cmake b/opus_config.cmake
index 8d4283c0..5bde77eb 100644
--- a/opus_config.cmake
+++ b/opus_config.cmake
@@ -26,7 +26,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "(i[0-9]86|x86|X86|amd64|AMD64|x86_64)")
else()
set(OPUS_CPU_X86 1)
endif()
-elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
+elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm|aarch64)")
set(OPUS_CPU_ARM 1)
endif()
@@ -37,11 +37,13 @@ if(OPUS_CPU_X86 OR OPUS_CPU_X64)
elseif(OPUS_CPU_ARM)
opus_detect_neon(COMPILER_SUPPORT_NEON)
if(COMPILER_SUPPORT_NEON)
- option(OPUS_USE_NEON "Option to turn off SSE" ON)
- option(OPUS_MAY_SUPPORT_NEON "Does runtime check for neon support" ON)
+ option(OPUS_USE_NEON "Option to enable NEON" ON)
+ option(OPUS_MAY_HAVE_NEON "Does runtime check for neon support" ON)
option(OPUS_PRESUME_NEON "Assume target CPU has NEON support" OFF)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
set(OPUS_PRESUME_NEON ON)
+ elseif(CMAKE_SYSTEM_NAME MATCHES "iOS")
+ set(OPUS_PRESUME_NEON ON)
endif()
endif()
endif()
diff --git a/opus_functions.cmake b/opus_functions.cmake
index 04249ace..a3ac1c09 100644
--- a/opus_functions.cmake
+++ b/opus_functions.cmake
@@ -192,7 +192,7 @@ function(opus_detect_sse COMPILER_SUPPORT_SIMD)
endfunction()
function(opus_detect_neon COMPILER_SUPPORT_NEON)
- if(CMAKE_SYSTEM_PROCESSOR MATCHES "(armv7-a|aarch64)")
+ if(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm|aarch64)")
message(STATUS "Check NEON support by compiler")
check_include_file(arm_neon.h HAVE_ARM_NEON_H)
if(HAVE_ARM_NEON_H)
@@ -209,6 +209,12 @@ function(opus_supports_cpu_detection RUNTIME_CPU_CAPABILITY_DETECTION)
endif()
if(HAVE_INTRIN_H OR HAVE_CPUID_H)
set(RUNTIME_CPU_CAPABILITY_DETECTION 1 PARENT_SCOPE)
+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm|aarch64)")
+ # ARM cpu detection is implemented for Windows and anything
+ # using a Linux kernel (such as Android).
+ if (CMAKE_SYSTEM_NAME MATCHES "(Windows|Linux|Android)")
+ set(RUNTIME_CPU_CAPABILITY_DETECTION 1 PARENT_SCOPE)
+ endif ()
else()
set(RUNTIME_CPU_CAPABILITY_DETECTION 0 PARENT_SCOPE)
endif()