mirror of
https://chromium.googlesource.com/libyuv/libyuv
synced 2025-12-06 16:56:55 +08:00
CMake: Improve the checks for CMAKE_SYSTEM_PROCESSOR
CMAKE_SYSTEM_PROCESSOR doesn't strictly have the values "arm" or "aarch64", it can have more varied spellings. When cross compiling, the value is specified by the user, but when doing native compilation, the variable gets its value from CMAKE_HOST_SYSTEM_PROCESSOR. This variable is defined to have the value of $(uname -m) on many Unixes. This can give values like "armv7l" on some hosts, and "arm64" on macOS. Thus, when checking for aarch64, also check for the spelling "arm64". And when checking for arm, check for any string that starts with "arm", except for "arm64". Change-Id: I99695ee2f3439098c897ae1408605781cd0db9fd Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5444427 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
parent
3af6cafe8d
commit
38fa3ce2c9
@ -83,7 +83,7 @@ SET(ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_common_objects>)
|
||||
if(NOT MSVC)
|
||||
STRING(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" arch_lowercase)
|
||||
|
||||
if(arch_lowercase STREQUAL "arm")
|
||||
if(arch_lowercase MATCHES "^arm" AND NOT arch_lowercase STREQUAL "arm64")
|
||||
# Enable Arm Neon kernels.
|
||||
ADD_DEFINITIONS(-DLIBYUV_NEON=1)
|
||||
ADD_LIBRARY(${ly_lib_name}_neon OBJECT
|
||||
@ -95,7 +95,7 @@ if(NOT MSVC)
|
||||
LIST(APPEND ly_lib_parts $<TARGET_OBJECTS:${ly_lib_name}_neon>)
|
||||
endif()
|
||||
|
||||
if(arch_lowercase STREQUAL "aarch64")
|
||||
if(arch_lowercase STREQUAL "aarch64" OR arch_lowercase STREQUAL "arm64")
|
||||
# Enable AArch64 Neon dot-product and i8mm kernels.
|
||||
ADD_LIBRARY(${ly_lib_name}_neon64 OBJECT
|
||||
${ly_src_dir}/compare_neon64.cc
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user