2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2015-11-17 09:47:36 +03:00
|
|
|
# vim: set filetype=python:
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
|
|
# Add assembler flags and includes
|
|
|
|
ASFLAGS += CONFIG['FFVPX_ASFLAGS']
|
2018-11-16 04:20:58 +03:00
|
|
|
ASFLAGS += ['-I%s/media/ffvpx/' % TOPSRCDIR]
|
|
|
|
ASFLAGS += ['-I%s/media/ffvpx/libavcodec/x86/' % TOPSRCDIR]
|
|
|
|
ASFLAGS += ['-I%s/media/ffvpx/libavutil/x86/' % TOPSRCDIR]
|
2015-11-17 09:47:36 +03:00
|
|
|
|
2016-03-03 19:38:59 +03:00
|
|
|
if CONFIG['FFVPX_ASFLAGS']:
|
2019-01-11 21:17:36 +03:00
|
|
|
if CONFIG['FFVPX_USE_YASM']:
|
2017-11-02 03:48:00 +03:00
|
|
|
USE_YASM = True
|
2019-01-11 21:17:36 +03:00
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
2015-11-17 09:47:36 +03:00
|
|
|
# Fix inline symbols and math defines for windows.
|
|
|
|
DEFINES['_USE_MATH_DEFINES'] = True
|
|
|
|
DEFINES['inline'] = "__inline"
|
2019-01-11 21:17:36 +03:00
|
|
|
|
|
|
|
if USE_YASM and not CONFIG['YASM_HAS_AVX2']:
|
|
|
|
DEFINES['YASM_MISSING_AVX2'] = True
|
2017-10-31 21:42:27 +03:00
|
|
|
|
|
|
|
|
2015-11-17 09:47:36 +03:00
|
|
|
LOCAL_INCLUDES += ['/media/ffvpx']
|
|
|
|
|
|
|
|
# We allow warnings for third-party code that can be updated from upstream.
|
2017-10-26 01:12:09 +03:00
|
|
|
AllowCompilerWarnings()
|
2017-07-29 21:05:34 +03:00
|
|
|
|
2015-11-17 09:47:36 +03:00
|
|
|
# Suppress warnings in third-party code.
|
2019-02-15 00:45:27 +03:00
|
|
|
CFLAGS += [
|
|
|
|
'-Wno-parentheses',
|
|
|
|
'-Wno-pointer-sign',
|
|
|
|
'-Wno-sign-compare',
|
|
|
|
'-Wno-switch',
|
|
|
|
'-Wno-type-limits',
|
|
|
|
'-Wno-unused-function',
|
|
|
|
# XXX This does not seem to have any effect on some versions of GCC.
|
|
|
|
'-Wno-deprecated-declarations',
|
|
|
|
]
|
|
|
|
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
|
2015-11-17 09:47:36 +03:00
|
|
|
CFLAGS += [
|
2019-02-15 00:45:27 +03:00
|
|
|
'-Wno-absolute-value',
|
|
|
|
'-Wno-incompatible-pointer-types',
|
|
|
|
'-Wno-string-conversion',
|
|
|
|
'-Wno-visibility',
|
2015-11-17 09:47:36 +03:00
|
|
|
]
|
2019-02-15 00:45:27 +03:00
|
|
|
if CONFIG['CC_TYPE'] == 'clang-cl':
|
2015-11-17 09:47:36 +03:00
|
|
|
CFLAGS += [
|
2019-02-15 00:45:27 +03:00
|
|
|
'-Wno-inconsistent-dllimport',
|
|
|
|
'-Wno-macro-redefined', # 'WIN32_LEAN_AND_MEAN' macro redefined
|
2015-11-17 09:47:36 +03:00
|
|
|
]
|
2019-02-15 00:45:27 +03:00
|
|
|
if CONFIG['CC_TYPE'] == 'clang':
|
2017-07-29 21:05:34 +03:00
|
|
|
CFLAGS += [
|
2019-02-15 00:45:27 +03:00
|
|
|
# Workaround for https://bugs.llvm.org/show_bug.cgi?id=26828#c4 :
|
|
|
|
'-ffreestanding',
|
2017-07-29 21:05:34 +03:00
|
|
|
]
|
2019-02-15 00:45:27 +03:00
|
|
|
else:
|
2015-11-17 09:47:36 +03:00
|
|
|
CFLAGS += [
|
2019-02-15 00:45:27 +03:00
|
|
|
'-Wno-discarded-qualifiers',
|
|
|
|
'-Wno-maybe-uninitialized',
|
2015-11-17 09:47:36 +03:00
|
|
|
]
|
2019-02-15 00:45:27 +03:00
|
|
|
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
|
|
|
|
# Force visibility of cpu and av_log symbols.
|
|
|
|
CFLAGS += ['-include', 'libavutil_visibility.h']
|
|
|
|
if CONFIG['CC_TYPE'] == 'clang-cl':
|
2017-10-24 22:44:23 +03:00
|
|
|
LOCAL_INCLUDES += ['/media/ffvpx/compat/atomics/win32']
|
2015-11-17 09:47:36 +03:00
|
|
|
DEFINES['HAVE_AV_CONFIG_H'] = True
|
2016-04-11 08:25:56 +03:00
|
|
|
|
|
|
|
if CONFIG['MOZ_DEBUG']:
|
|
|
|
# Enable all assertions in debug builds.
|
|
|
|
DEFINES['ASSERT_LEVEL'] = 2
|
2016-10-08 12:14:49 +03:00
|
|
|
elif not CONFIG['RELEASE_OR_BETA']:
|
2016-04-11 08:25:56 +03:00
|
|
|
# Enable fast assertions in opt builds of Nightly and Aurora.
|
|
|
|
DEFINES['ASSERT_LEVEL'] = 1
|