summaryrefslogtreecommitdiff
path: root/modules/webm/libvpx
diff options
context:
space:
mode:
Diffstat (limited to 'modules/webm/libvpx')
-rw-r--r--modules/webm/libvpx/SCsub44
-rw-r--r--modules/webm/libvpx/yasm_osx_fat.py38
2 files changed, 17 insertions, 65 deletions
diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub
index aa282338cb..0ebafa022d 100644
--- a/modules/webm/libvpx/SCsub
+++ b/modules/webm/libvpx/SCsub
@@ -254,7 +254,6 @@ env_libvpx = env.Clone()
env_libvpx.Append(CPPPATH=[libvpx_dir])
cpu_bits = env["bits"]
-osx_fat = (env["platform"] == 'osx' and cpu_bits == 'fat')
webm_cpu_x86 = False
webm_cpu_arm = False
if env["platform"] == 'uwp':
@@ -269,11 +268,8 @@ else:
is_android_x86 = (env["platform"] == 'android' and env["android_arch"] == 'x86')
if is_android_x86:
cpu_bits = '32'
- if osx_fat:
- webm_cpu_x86 = True
- else:
- webm_cpu_x86 = not is_x11_or_server_arm and (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86 or is_ios_x86)
- webm_cpu_arm = is_x11_or_server_arm or (not is_ios_x86 and env["platform"] == 'iphone') or (not is_android_x86 and env["platform"] == 'android')
+ webm_cpu_x86 = not is_x11_or_server_arm and (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86 or is_ios_x86)
+ webm_cpu_arm = is_x11_or_server_arm or (not is_ios_x86 and env["platform"] == 'iphone') or (not is_android_x86 and env["platform"] == 'android')
if webm_cpu_x86:
import subprocess
@@ -303,28 +299,22 @@ if webm_cpu_x86:
webm_simd_optimizations = False
if webm_cpu_x86:
- if osx_fat:
- #'osx' platform only: run python script which will compile using 'yasm' command and then merge 32-bit and 64-bit using 'lipo' command
- env_libvpx["AS"] = 'python modules/webm/libvpx/yasm_osx_fat.py'
- env_libvpx["ASFLAGS"] = '-I' + libvpx_dir[1:]
- env_libvpx["ASCOM"] = '$AS $ASFLAGS $TARGET $SOURCES'
+ if env["platform"] == 'windows' or env["platform"] == 'uwp':
+ env_libvpx["ASFORMAT"] = 'win'
+ elif env["platform"] == 'osx' or env["platform"] == "iphone":
+ env_libvpx["ASFORMAT"] = 'macho'
else:
- if env["platform"] == 'windows' or env["platform"] == 'uwp':
- env_libvpx["ASFORMAT"] = 'win'
- elif env["platform"] == 'osx' or env["platform"] == "iphone":
- env_libvpx["ASFORMAT"] = 'macho'
- else:
- env_libvpx["ASFORMAT"] = 'elf'
- env_libvpx["ASFORMAT"] += cpu_bits
-
- env_libvpx["AS"] = 'yasm'
- env_libvpx["ASFLAGS"] = '-I' + libvpx_dir[1:] + ' -f $ASFORMAT -D $ASCPU'
- env_libvpx["ASCOM"] = '$AS $ASFLAGS -o $TARGET $SOURCES'
+ env_libvpx["ASFORMAT"] = 'elf'
+ env_libvpx["ASFORMAT"] += cpu_bits
+
+ env_libvpx["AS"] = 'yasm'
+ env_libvpx["ASFLAGS"] = '-I' + libvpx_dir[1:] + ' -f $ASFORMAT -D $ASCPU'
+ env_libvpx["ASCOM"] = '$AS $ASFLAGS -o $TARGET $SOURCES'
- if cpu_bits == '32':
- env_libvpx["ASCPU"] = 'X86_32'
- elif cpu_bits == '64':
- env_libvpx["ASCPU"] = 'X86_64'
+ if cpu_bits == '32':
+ env_libvpx["ASCPU"] = 'X86_32'
+ elif cpu_bits == '64':
+ env_libvpx["ASCPU"] = 'X86_64'
env_libvpx.Append(CCFLAGS=['-DWEBM_X86ASM'])
@@ -375,7 +365,7 @@ if webm_cpu_x86:
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_intrin_x86)
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_x86asm)
- if cpu_bits == '64' or osx_fat:
+ if cpu_bits == '64':
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_x86_64asm)
elif webm_cpu_arm:
env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm)
diff --git a/modules/webm/libvpx/yasm_osx_fat.py b/modules/webm/libvpx/yasm_osx_fat.py
deleted file mode 100644
index 0065e2766c..0000000000
--- a/modules/webm/libvpx/yasm_osx_fat.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import os
-
-includes = sys.argv[1]
-output_file = sys.argv[2]
-input_file = sys.argv[3]
-
-can_remove = {}
-
-lipo_command = ''
-
-exit_code = 1
-
-for arch in ['32', '64']:
- if arch == '32' and input_file.endswith('x86_64.asm'):
- can_remove[arch] = False
- else:
- command = 'yasm ' + includes + ' -f macho' + arch + ' -D X86_' + arch + ' -o ' + output_file + '.' + arch + ' ' + input_file
- print(command)
- if os.system(command) == 0:
- lipo_command += output_file + '.' + arch + ' '
- can_remove[arch] = True
- else:
- can_remove[arch] = False
-
-if lipo_command != '':
- lipo_command = 'lipo -create ' + lipo_command + '-output ' + output_file
- print(lipo_command)
- if os.system(lipo_command) == 0:
- exit_code = 0
-
-for arch in ['32', '64']:
- if can_remove[arch]:
- os.remove(output_file + '.' + arch)
-
-sys.exit(exit_code)