1 # -*- Mode: python; 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/.
8 BUG_COMPONENT = ('Core', 'Audio/Video')
10 include('sources.mozbuild')
12 # Linux, Mac and Win share file lists for x86* but not configurations.
13 if CONFIG['CPU_ARCH'] == 'x86_64':
14 EXPORTS.aom += files['X64_EXPORTS']
15 SOURCES += files['X64_SOURCES']
17 if CONFIG['OS_TARGET'] == 'WINNT':
18 ASFLAGS += [ '-I%s/media/libaom/config/win/x64/' % TOPSRCDIR ]
19 LOCAL_INCLUDES += [ '/media/libaom/config/win/x64/' ]
20 EXPORTS.aom += [ 'config/win/x64/config/aom_config.h' ]
21 # This code is not included in our PGO profile, and pointlessly
22 # PGO-optimizing it slows down our builds a lot.
24 elif CONFIG['OS_TARGET'] == 'Darwin':
25 ASFLAGS += [ '-I%s/media/libaom/config/mac/x64/' % TOPSRCDIR ]
26 LOCAL_INCLUDES += [ '/media/libaom/config/mac/x64/' ]
27 EXPORTS.aom += [ 'config/mac/x64/config/aom_config.h' ]
28 else: # Android, Linux, BSDs, etc.
29 ASFLAGS += [ '-I%s/media/libaom/config/linux/x64/' % TOPSRCDIR ]
30 LOCAL_INCLUDES += [ '/media/libaom/config/linux/x64/' ]
31 EXPORTS.aom += [ 'config/linux/x64/config/aom_config.h' ]
32 elif CONFIG['CPU_ARCH'] == 'x86':
33 EXPORTS.aom += files['IA32_EXPORTS']
34 SOURCES += files['IA32_SOURCES']
36 if CONFIG['OS_TARGET'] == 'WINNT':
37 ASFLAGS += [ '-I%s/media/libaom/config/win/ia32/' % TOPSRCDIR ]
38 LOCAL_INCLUDES += [ '/media/libaom/config/win/ia32/' ]
39 EXPORTS.aom += [ 'config/win/ia32/config/aom_config.h' ]
40 NO_PGO = True # Compiler OOMs, bug 1445922
41 else: # Android, Linux, BSDs, etc.
42 ASFLAGS += [ '-I%s/media/libaom/config/linux/ia32/' % TOPSRCDIR ]
43 LOCAL_INCLUDES += [ '/media/libaom/config/linux/ia32/' ]
44 EXPORTS.aom += [ 'config/linux/ia32/config/aom_config.h' ]
45 elif CONFIG['CPU_ARCH'] == 'arm':
46 EXPORTS.aom += files['ARM_EXPORTS']
48 '-I%s/media/libaom/config/linux/arm/' % TOPSRCDIR,
49 '-I%s/libaom' % OBJDIR,
51 LOCAL_INCLUDES += [ '/media/libaom/config/linux/arm/' ]
52 EXPORTS.aom += [ 'config/linux/arm/config/aom_config.h' ]
54 SOURCES += files['ARM_SOURCES']
57 if f.endswith('neon.c'):
58 SOURCES[f].flags += CONFIG['VPX_ASFLAGS']
60 if CONFIG['OS_TARGET'] == 'Android':
63 '%%%s/sources/android/cpufeatures' % CONFIG['ANDROID_NDK'],
66 # Generic C-only configuration
67 EXPORTS.aom += files['GENERIC_EXPORTS']
68 SOURCES += files['GENERIC_SOURCES']
69 ASFLAGS += [ '-I%s/media/libaom/config/generic/' % TOPSRCDIR ]
70 LOCAL_INCLUDES += [ '/media/libaom/config/generic/' ]
71 EXPORTS.aom += [ 'config/generic/config/aom_config.h' ]
73 # We allow warnings for third-party code that can be updated from upstream.
74 AllowCompilerWarnings()
76 FINAL_LIBRARY = 'gkmedias'
78 if CONFIG['OS_TARGET'] == 'Android':
79 # Older versions of the Android NDK don't pre-define anything to indicate
80 # the OS they're on, so do it for them.
81 DEFINES['__linux__'] = True
84 if f.endswith('sse2.c'):
85 SOURCES[f].flags += CONFIG['SSE2_FLAGS']
86 elif f.endswith('ssse3.c'):
87 SOURCES[f].flags += ['-mssse3']
88 elif f.endswith('sse4.c'):
89 SOURCES[f].flags += ['-msse4.1']
90 elif f.endswith('sse42.c'):
91 SOURCES[f].flags += ['-msse4.2']
92 elif f.endswith('avx.c'):
93 SOURCES[f].flags += ['-mavx']
94 elif f.endswith('avx2.c'):
95 SOURCES[f].flags += ['-mavx2']
97 # Suppress warnings in third-party code.
100 '-Wno-unused-function', # so many of these warnings; just ignore them
102 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
104 '-Wno-unreachable-code',
105 '-Wno-unneeded-internal-declaration',
108 ASFLAGS += CONFIG['VPX_ASFLAGS']
111 '-I%s/third_party/aom/' % TOPSRCDIR,
115 '/media/libaom/config', # aom_version.h
119 if CONFIG['OS_TARGET'] == 'Linux':
120 # For fuzzing, We only support building on Linux currently.
121 include('/tools/fuzzing/libfuzzer-config.mozbuild')
122 if CONFIG['FUZZING_INTERFACES']: