Bug 1874684 - Part 28: Return DateDuration from DifferenceISODateTime. r=mgaudet
[gecko.git] / media / libaom / moz.build
blob2f392ed5bfe5bd1dd7583d4f2d17bdc93d5e73a7
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['TARGET_CPU'] == '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         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.
24         NO_PGO = True
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']
36     USE_NASM = True
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']
48     ASFLAGS += [
49         '-I%s/media/libaom/config/linux/arm/' % TOPSRCDIR,
50         '-I%s/libaom' % OBJDIR,
51     ]
52     LOCAL_INCLUDES += [ '/media/libaom/config/linux/arm/' ]
53     EXPORTS.aom += [ 'config/linux/arm/config/aom_config.h' ]
55     SOURCES += files['ARM_SOURCES']
57     for f in SOURCES:
58         if f.endswith('neon.c'):
59             SOURCES[f].flags += CONFIG['NEON_FLAGS']
61     if CONFIG['OS_TARGET'] == 'Android':
62         # For cpu-features.h
63         LOCAL_INCLUDES += [
64             '%%%s/sources/android/cpufeatures' % CONFIG['ANDROID_NDK'],
65         ]
66 else:
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'
78 NoVisibilityFlags()
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
85 for f in SOURCES:
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.
104 CFLAGS += [
105     '-Wno-sign-compare',
106     '-Wno-unused-function', # so many of these warnings; just ignore them
108 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
109     CFLAGS += [
110         '-Wno-unreachable-code',
111         '-Wno-unneeded-internal-declaration',
112     ]
114 ASFLAGS += CONFIG['VPX_ASFLAGS']
115 ASFLAGS += [
116     '-I./',
117     '-I%s/third_party/aom/' % TOPSRCDIR,
120 LOCAL_INCLUDES += [
121     '/media/libaom/config', # aom_version.h
122     '/third_party/aom',
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']:
130 #         TEST_DIRS += [
131 #             'test/fuzztest'
132 #     ]