Bug 1788251 [wpt PR 35638] - Prerender2: allow referrer policy mismatches, a=testonly
[gecko.git] / media / libaom / moz.build
blobfd8c7f2b3388b08bd43bf1f92989dfbcdde99ebc
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/.
7 with Files('*'):
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']
16     USE_NASM = True
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.
23         NO_PGO = True
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']
35     USE_NASM = True
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']
47     ASFLAGS += [
48         '-I%s/media/libaom/config/linux/arm/' % TOPSRCDIR,
49         '-I%s/libaom' % OBJDIR,
50     ]
51     LOCAL_INCLUDES += [ '/media/libaom/config/linux/arm/' ]
52     EXPORTS.aom += [ 'config/linux/arm/config/aom_config.h' ]
54     SOURCES += files['ARM_SOURCES']
56     for f in SOURCES:
57         if f.endswith('neon.c'):
58             SOURCES[f].flags += CONFIG['VPX_ASFLAGS']
60     if CONFIG['OS_TARGET'] == 'Android':
61         # For cpu-features.h
62         LOCAL_INCLUDES += [
63             '%%%s/sources/android/cpufeatures' % CONFIG['ANDROID_NDK'],
64         ]
65 else:
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
83 for f in SOURCES:
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.
98 CFLAGS += [
99     '-Wno-sign-compare',
100     '-Wno-unused-function', # so many of these warnings; just ignore them
102 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
103     CFLAGS += [
104         '-Wno-unreachable-code',
105         '-Wno-unneeded-internal-declaration',
106     ]
108 ASFLAGS += CONFIG['VPX_ASFLAGS']
109 ASFLAGS += [
110     '-I./',
111     '-I%s/third_party/aom/' % TOPSRCDIR,
114 LOCAL_INCLUDES += [
115     '/media/libaom/config', # aom_version.h
116     '/third_party/aom',
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']:
123         TEST_DIRS += [
124             'test/fuzztest'
125     ]