Bumping manifests a=b2g-bump
[gecko.git] / media / libvpx / moz.build
blob5efe44f178d45208558202c03853118d97dadcea
1 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 include('sources.mozbuild')
9 EXPORTS.vpx += files['EXPORTS']
11 if CONFIG['VPX_NEED_OBJ_INT_EXTRACT']:
12     HOST_SOURCES += [
13         'build/make/obj_int_extract.c',
14     ]
16     HostProgram('host_obj_int_extract')
18 # Unify fewer files together to reduce the chance of name collision
19 FILES_PER_UNIFIED_FILE = 8
21 SOURCES += files['SOURCES']
22 UNIFIED_SOURCES += files['UNIFIED_SOURCES']
24 if CONFIG['MOZ_VPX_ERROR_CONCEALMENT']:
25     SOURCES += files['ERROR_CONCEALMENT']
27 if CONFIG['VPX_X86_ASM'] and CONFIG['OS_TARGET'] == 'WINNT':
28     offset_sources = [
29         'vp8/encoder/vp8_asm_enc_offsets.c',
30         'vpx_scale/vpx_scale_asm_offsets.c',
31     ]
32     SOURCES += offset_sources
33     # Bug 934984 - MSVC bustage when /GL is specified
34     if CONFIG['_MSC_VER']:
35         for s in offset_sources:
36             SOURCES[s].flags += ['-GL-']
38 if CONFIG['VPX_X86_ASM']:
39     SOURCES += files['X86_ASM']
41     if '64' in CONFIG['OS_TEST']:
42         SOURCES += files['X86-64_ASM']
44     # AVX2 only supported on
45     # Darwin and mingw toolchains right now
46     if CONFIG['OS_TARGET'] == 'Darwin' or (CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['GNU_CC']):
47         SOURCES += files['AVX2']
49     #postproc is only enabled on x86 with asm
50     SOURCES += files['VP8_POSTPROC']
52 arm_asm_files = []
53 if CONFIG['VPX_ARM_ASM']:
54     arm_asm_files += files['ARM_ASM']
56     if CONFIG['VPX_AS_CONVERSION']:
57         GENERATED_SOURCES += [ "%s.%s" % (f, CONFIG['VPX_ASM_SUFFIX'])
58             for f in sorted(arm_asm_files) if f.endswith('.asm')
59         ]
60         SOURCES += [
61             f for f in sorted(arm_asm_files) if not f.endswith('.asm')
62         ]
63     else:
64         SOURCES += sorted(arm_asm_files)
66     for f in SOURCES:
67         if f.endswith('.c') and 'neon' in f:
68             SOURCES[f].flags += ['-march=armv7-a', '-mthumb', '-mfloat-abi=softfp', '-mfpu=neon']
70 # boolhuff_armv5te.asm defines the same functions as boolhuff.c instead of
71 # using RTCD, so we have to make sure we only add one of the two.
72 if 'vp8/encoder/arm/armv5te/boolhuff_armv5te.asm' not in arm_asm_files:
73     SOURCES += [
74         'vp8/encoder/boolhuff.c',
75     ]
77 MSVC_ENABLE_PGO = True
79 if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
80     NO_VISIBILITY_FLAGS = True
82 FINAL_LIBRARY = 'gkmedias'
84 DEFINES['HAVE_CONFIG_H'] = 'vpx_config.h'
86 if CONFIG['OS_TARGET'] == 'Android':
87     # Older versions of the Android NDK don't pre-define anything to indicate
88     # the OS they're on, so do it for them.
89     DEFINES['__linux__'] = True
91     if not CONFIG['MOZ_WEBRTC']:
92         SOURCES += [
93             '%s/sources/android/cpufeatures/cpu-features.c' % CONFIG['ANDROID_NDK'],
94         ]
96 if CONFIG['CLANG_CL'] or not CONFIG['_MSC_VER']:
97     for f in SOURCES:
98         if f.endswith('.c'):
99             if 'sse2' in f:
100                 SOURCES[f].flags += CONFIG['SSE2_FLAGS']
101             if 'ssse3' in f:
102                 SOURCES[f].flags += ['-mssse3']
103             if 'sse4' in f:
104                 SOURCES[f].flags += ['-msse4.1']
105             if 'avx2' in f:
106                 SOURCES[f].flags += ['-mavx2']
108 # Suppress warnings in third-party code.
109 if CONFIG['GNU_CC']:
110     CFLAGS += ['-Wno-sign-compare']