Backed out changeset 2092d43bfaae (bug 1880539) for causing bc failures @ browser...
[gecko.git] / media / ffvpx / ffvpxcommon.mozbuild
blobbf46fb5d83ea9178fb8c3440451c58e3a06bb882
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 # Add assembler flags and includes
8 if CONFIG['TARGET_CPU'] != 'aarch64':
9     ASFLAGS += CONFIG['FFVPX_ASFLAGS']
10     ASFLAGS += ['-I%s/media/ffvpx/' % TOPSRCDIR]
11     ASFLAGS += ['-I%s/media/ffvpx/libavcodec/x86/' % TOPSRCDIR]
12     ASFLAGS += ['-I%s/media/ffvpx/libavutil/x86/' % TOPSRCDIR]
14 if CONFIG['FFVPX_ASFLAGS']:
15     if CONFIG['FFVPX_USE_NASM']:
16         USE_NASM = True
18     if CONFIG['OS_ARCH'] == 'WINNT':
19        # Fix inline symbols and math defines for windows.
20         DEFINES['_USE_MATH_DEFINES'] = True
21         DEFINES['inline'] = "__inline"
23 LOCAL_INCLUDES += ['/media/ffvpx']
25 USE_LIBS += [ 'gkcodecs' ]
27 # We allow warnings for third-party code that can be updated from upstream.
28 AllowCompilerWarnings()
30 # Suppress warnings in third-party code.
31 CFLAGS += [
32     '-Wno-parentheses',
33     '-Wno-pointer-sign',
34     '-Wno-sign-compare',
35     '-Wno-switch',
36     '-Wno-type-limits',
37     '-Wno-unused-function',
38     # XXX This does not seem to have any effect on some versions of GCC.
39     '-Wno-deprecated-declarations',
41 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
42     CFLAGS += [
43         '-Wno-absolute-value',
44         '-Wno-incompatible-pointer-types',
45         '-Wno-string-conversion',
46         '-Wno-visibility',
47     ]
48     if CONFIG['CC_TYPE'] == 'clang-cl':
49         CFLAGS += [
50             '-Wno-inconsistent-dllimport',
51             '-Wno-macro-redefined', # 'WIN32_LEAN_AND_MEAN' macro redefined
52         ]
53 else:
54     CFLAGS += [
55         '-Wno-discarded-qualifiers',
56         '-Wno-maybe-uninitialized',
57     ]
58 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
59     # Force visibility of cpu and av_log symbols.
60     CFLAGS += ['-include', 'libavutil_visibility.h']
61 if CONFIG['CC_TYPE'] == 'clang-cl':
62     LOCAL_INCLUDES += ['/media/ffvpx/compat/atomics/win32']
63 DEFINES['HAVE_AV_CONFIG_H'] = True
65 if CONFIG['MOZ_DEBUG']:
66     # Enable all assertions in debug builds.
67     DEFINES['ASSERT_LEVEL'] = 2
68 elif not CONFIG['RELEASE_OR_BETA']:
69     # Enable fast assertions in opt builds of Nightly and Aurora.
70     DEFINES['ASSERT_LEVEL'] = 1
72 # Add libFuzzer configuration directives
73 include('/tools/fuzzing/libfuzzer-config.mozbuild')