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['TARGET_CPU'] == '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 SOURCES += files['X64_WIN_SOURCES']
22 # This code is not included in our PGO profile, and pointlessly
23 # PGO-optimizing it slows down our builds a lot.
25 elif CONFIG['OS_TARGET'] == 'Darwin':
26 ASFLAGS += [ '-I%s/media/libaom/config/mac/x64/' % TOPSRCDIR ]
27 LOCAL_INCLUDES += [ '/media/libaom/config/mac/x64/' ]
28 EXPORTS.aom += [ 'config/mac/x64/config/aom_config.h' ]
29 else: # Android, Linux, BSDs, etc.
30 ASFLAGS += [ '-I%s/media/libaom/config/linux/x64/' % TOPSRCDIR ]
31 LOCAL_INCLUDES += [ '/media/libaom/config/linux/x64/' ]
32 EXPORTS.aom += [ 'config/linux/x64/config/aom_config.h' ]
33 elif CONFIG['TARGET_CPU'] == 'x86':
34 EXPORTS.aom += files['IA32_EXPORTS']
35 SOURCES += files['IA32_SOURCES']
37 if CONFIG['OS_TARGET'] == 'WINNT':
38 ASFLAGS += [ '-I%s/media/libaom/config/win/ia32/' % TOPSRCDIR ]
39 LOCAL_INCLUDES += [ '/media/libaom/config/win/ia32/' ]
40 EXPORTS.aom += [ 'config/win/ia32/config/aom_config.h' ]
41 NO_PGO = True # Compiler OOMs, bug 1445922
42 else: # Android, Linux, BSDs, etc.
43 ASFLAGS += [ '-I%s/media/libaom/config/linux/ia32/' % TOPSRCDIR ]
44 LOCAL_INCLUDES += [ '/media/libaom/config/linux/ia32/' ]
45 EXPORTS.aom += [ 'config/linux/ia32/config/aom_config.h' ]
46 elif CONFIG['TARGET_CPU'] == 'arm':
47 EXPORTS.aom += files['ARM_EXPORTS']
49 '-I%s/media/libaom/config/linux/arm/' % TOPSRCDIR,
50 '-I%s/libaom' % OBJDIR,
52 LOCAL_INCLUDES += [ '/media/libaom/config/linux/arm/' ]
53 EXPORTS.aom += [ 'config/linux/arm/config/aom_config.h' ]
55 SOURCES += files['ARM_SOURCES']
58 if f.endswith('neon.c'):
59 SOURCES[f].flags += CONFIG['NEON_FLAGS']
61 if CONFIG['OS_TARGET'] == 'Android':
64 '%%%s/sources/android/cpufeatures' % CONFIG['ANDROID_NDK'],
67 # Generic C-only configuration
68 EXPORTS.aom += files['GENERIC_EXPORTS']
69 SOURCES += files['GENERIC_SOURCES']
70 ASFLAGS += [ '-I%s/media/libaom/config/generic/' % TOPSRCDIR ]
71 LOCAL_INCLUDES += [ '/media/libaom/config/generic/' ]
72 EXPORTS.aom += [ 'config/generic/config/aom_config.h' ]
74 # We allow warnings for third-party code that can be updated from upstream.
75 AllowCompilerWarnings()
77 FINAL_LIBRARY = 'gkcodecs'
80 if CONFIG['OS_TARGET'] == 'Android':
81 # Older versions of the Android NDK don't pre-define anything to indicate
82 # the OS they're on, so do it for them.
83 DEFINES['__linux__'] = True
86 if f.endswith('sse2.c'):
87 SOURCES[f].flags += CONFIG['SSE2_FLAGS']
88 elif f.endswith('ssse3.c'):
89 SOURCES[f].flags += ['-mssse3']
90 elif f.endswith('sse3.c'):
91 SOURCES[f].flags += ['-msse3']
92 elif f.endswith('sse4.c'):
93 SOURCES[f].flags += ['-msse4.1']
94 elif f.endswith('sse42.c'):
95 SOURCES[f].flags += ['-msse4.2']
96 elif f.endswith('avx.c'):
97 SOURCES[f].flags += ['-mavx']
98 elif f.endswith('avx2.c'):
99 SOURCES[f].flags += ['-mavx2']
101 SOURCES += [ 'build_config.c' ]
103 # Suppress warnings in third-party code.
106 '-Wno-unused-function', # so many of these warnings; just ignore them
108 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
110 '-Wno-unreachable-code',
111 '-Wno-unneeded-internal-declaration',
114 ASFLAGS += CONFIG['VPX_ASFLAGS']
117 '-I%s/third_party/aom/' % TOPSRCDIR,
121 '/media/libaom/config', # aom_version.h
125 # Disabled for now, see https://bugzilla.mozilla.org/show_bug.cgi?id=1869986
126 # if CONFIG['OS_TARGET'] == 'Linux':
127 # # For fuzzing, We only support building on Linux currently.
128 # include('/tools/fuzzing/libfuzzer-config.mozbuild')
129 # if CONFIG['FUZZING_INTERFACES']: