Skip to content

Commit

Permalink
Ignore neon on the macos.
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Oct 18, 2024
1 parent f11b91e commit fa918ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 31 deletions.
43 changes: 13 additions & 30 deletions modules/webm/libvpx/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -227,30 +227,10 @@ webm_multithread = env_libvpx["platform"] != "javascript"
cpu = env_libvpx["arch"]
webm_cpu_x86 = False
webm_cpu_arm = False
if cpu == "x86_64" or cpu == "arm64" or cpu == "arm32":
import os
import subprocess

yasm_paths = [
"yasm",
"../../../yasm",
]

yasm_found = False

devnull = open(os.devnull)
for yasm_path in yasm_paths:
try:
yasm_found = True
subprocess.Popen([yasm_path, "--version"], stdout=devnull, stderr=devnull).communicate()
except Exception:
yasm_found = False
if yasm_found:
break

if not yasm_found:
webm_cpu_x86 = False
print("YASM is necessary for WebM SIMD optimizations.")
if cpu == "arm64" or cpu == "arm32":
webm_cpu_arm = True
elif cpu == "x86_64":
webm_cpu_x86 = True

webm_simd_optimizations = False

Expand Down Expand Up @@ -283,11 +263,11 @@ if webm_cpu_arm:
env_libvpx["ASFLAGS"] = ""
env_libvpx["ASCOM"] = "$AS $ASFLAGS -o $TARGET $SOURCES"

env_libvpx.Append(CPPDEFINES=["WEBM_ARMASM"])
env_libvpx.Append(CPPDEFINES=["WEBM_ARMASM", ""])

webm_simd_optimizations = True

if webm_simd_optimizations == False:
if not webm_simd_optimizations:
print("WebM SIMD optimizations are disabled. Check if your CPU architecture, CPU bits or platform are supported!")

env_libvpx.add_source_files(env_libvpx.modules_sources, libvpx_sources)
Expand Down Expand Up @@ -320,15 +300,18 @@ if webm_cpu_x86:

env_libvpx.add_source_files(env_libvpx.modules_sources, libvpx_sources_x86asm)
env_libvpx.add_source_files(env_libvpx.modules_sources, libvpx_sources_x86_64asm)
elif webm_cpu_arm:
if webm_cpu_arm:
env_libvpx.add_source_files(env_libvpx.modules_sources, libvpx_sources_arm)

if env_libvpx["platform"] == "android":
env_libvpx.Prepend(CPPPATH=[libvpx_dir + "third_party/android"])
env_libvpx.add_source_files(env_libvpx.modules_sources, [libvpx_dir + "third_party/android/cpu-features.c"])

env_libvpx_neon = env_libvpx.Clone()
env_libvpx_neon.add_source_files(env_libvpx.modules_sources, libvpx_sources_arm_neon)

if env_libvpx["platform"] == "iphone":
env_libvpx.add_source_files(env_libvpx.modules_sources, libvpx_sources_arm_neon_gas_apple)
env_libvpx.add_source_files(env_libvpx.modules_sources, libvpx_sources_arm_neon_gas)
if env_libvpx["platform"] == "iphone" or env_libvpx["platform"] == "macos":
# env_libvpx.add_source_files(env_libvpx.modules_sources, libvpx_sources_arm_neon_gas_apple)
pass
else:
env_libvpx.add_source_files(env_libvpx.modules_sources, libvpx_sources_arm_neon_gas)
2 changes: 1 addition & 1 deletion thirdparty/libvpx/vpx_ports/arm_cpudetect.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ int arm_cpu_caps(void) {
return flags & mask;
}

#elif defined(__ANDROID__) /* end _MSC_VER */
#elif defined(__ANDROID__) /* end __ANDROID__ */
#include <cpu-features.h>

int arm_cpu_caps(void) {
Expand Down

0 comments on commit fa918ca

Please sign in to comment.