2016-07-14 16:16:42 +00:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2015-11-17 06:47:36 +00: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']
|
|
|
|
ASFLAGS += ['-I%s/media/ffvpx' % TOPSRCDIR]
|
|
|
|
|
2016-03-03 16:38:59 +00:00
|
|
|
if CONFIG['FFVPX_ASFLAGS']:
|
|
|
|
USE_YASM = True
|
2015-11-17 06:47:36 +00:00
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
|
|
|
# Fix inline symbols and math defines for windows.
|
|
|
|
DEFINES['_USE_MATH_DEFINES'] = True
|
|
|
|
DEFINES['inline'] = "__inline"
|
|
|
|
# 32-bit windows need to prefix symbols with an underscore.
|
|
|
|
if CONFIG['CPU_ARCH'] == 'x86':
|
|
|
|
ASFLAGS += ['-DPREFIX']
|
2015-12-03 13:44:57 +00:00
|
|
|
ASFLAGS += ['-Pconfig_win32.asm']
|
|
|
|
else:
|
|
|
|
ASFLAGS += ['-Pconfig_win64.asm']
|
2015-11-17 06:47:36 +00:00
|
|
|
elif CONFIG['OS_ARCH'] == 'Darwin':
|
|
|
|
# 32/64-bit macosx assemblers need to prefix symbols with an underscore.
|
|
|
|
ASFLAGS += [
|
|
|
|
'-Pconfig_darwin64.asm',
|
|
|
|
'-DPREFIX'
|
|
|
|
]
|
|
|
|
else:
|
|
|
|
# Default to unix, similar to how ASFLAGS setup works in configure.in
|
|
|
|
ASFLAGS += ['-Pconfig_unix64.asm']
|
|
|
|
|
|
|
|
LOCAL_INCLUDES += ['/media/ffvpx']
|
|
|
|
|
|
|
|
# We allow warnings for third-party code that can be updated from upstream.
|
|
|
|
ALLOW_COMPILER_WARNINGS = True
|
2017-07-29 18:05:34 +00:00
|
|
|
|
2015-11-17 06:47:36 +00:00
|
|
|
# Suppress warnings in third-party code.
|
|
|
|
if CONFIG['GNU_CC']:
|
|
|
|
CFLAGS += [
|
|
|
|
'-Wno-parentheses',
|
|
|
|
'-Wno-pointer-sign',
|
|
|
|
'-Wno-sign-compare',
|
|
|
|
'-Wno-switch',
|
|
|
|
'-Wno-type-limits',
|
2015-12-03 13:44:57 +00:00
|
|
|
'-Wno-unused-function',
|
2017-06-02 21:07:17 +00:00
|
|
|
# XXX This does not seem to have any effect on some versions of GCC.
|
2015-12-03 13:44:57 +00:00
|
|
|
'-Wno-deprecated-declarations',
|
2015-11-17 06:47:36 +00:00
|
|
|
]
|
|
|
|
if CONFIG['CLANG_CXX']:
|
|
|
|
CFLAGS += [
|
|
|
|
'-Wno-incompatible-pointer-types-discards-qualifiers',
|
2017-08-10 16:55:42 +00:00
|
|
|
'-Wno-string-conversion',
|
|
|
|
'-Wno-visibility',
|
2015-11-17 06:47:36 +00:00
|
|
|
]
|
2017-07-29 18:05:34 +00:00
|
|
|
else:
|
|
|
|
CFLAGS += [
|
|
|
|
'-Wno-discarded-qualifiers',
|
|
|
|
'-Wno-maybe-uninitialized',
|
|
|
|
]
|
2016-04-11 05:25:56 +00:00
|
|
|
# Force visibility of cpu and av_log symbols.
|
|
|
|
CFLAGS += ['-include', 'libavutil_visibility.h']
|
2015-11-17 06:47:36 +00:00
|
|
|
elif CONFIG['_MSC_VER']:
|
|
|
|
CFLAGS += [
|
|
|
|
'-wd4090', # 'return' : different 'const' qualifiers
|
|
|
|
'-wd4018', # '>' : signed/unsigned mismatch
|
|
|
|
'-wd4305', # 'initializing' : truncation from '__int64' to 'double'
|
|
|
|
'-wd4554', # '>>' : check operator precedence for possible error
|
|
|
|
'-wd4307', # '+' : integral constant overflow'
|
|
|
|
'-wd4028', # formal parameter 1 different from declaration
|
|
|
|
'-wd4056', # overflow in floating-point constant arithmetic
|
|
|
|
'-wd4756', # overflow in constant arithmetic
|
|
|
|
'-wd4005', #'WIN32_LEAN_AND_MEAN' : macro redefinition
|
|
|
|
'-wd4054', # 'type cast' : from function pointer 'FARPROC' to data pointer 'void *'
|
|
|
|
'-wd4189', # local variable is initialized but not referenced
|
|
|
|
'-wd4133', # 'function' : incompatible types - from 'AVSampleFormat *' to 'int *'
|
|
|
|
'-wd4221', # nonstandard extension used
|
|
|
|
'-wd4206', # nonstandard extension used
|
|
|
|
'-wd4702', # unreachable code
|
|
|
|
'-wd4101', # unreferenced local variable
|
|
|
|
'-wd4245', # conversion from 'int' to 'uint32_t', signed/unsigned mismatch
|
|
|
|
'-wd4703', # potentially uninitialized local pointer
|
|
|
|
'-wd4293', # '<<' : shift count negative or too big, undefined behavior
|
2017-06-04 08:42:50 +00:00
|
|
|
'-wd4334', # '<<' : result of 32-bit shift implicitly converted to 64 bits
|
|
|
|
'-wd4996', # The compiler encountered a deprecated declaration.
|
2015-11-17 06:47:36 +00:00
|
|
|
# from FFmpeg configure
|
|
|
|
'-wd4244', '-wd4127', '-wd4018', '-wd4389', '-wd4146', '-wd4701',
|
|
|
|
'-wd4057', '-wd4204', '-wd4706', '-wd4305', '-wd4152', '-wd4324',
|
|
|
|
'-we4013', '-wd4100', '-wd4214', '-wd4307', '-wd4273', '-wd4554',
|
|
|
|
]
|
|
|
|
|
|
|
|
DEFINES['HAVE_AV_CONFIG_H'] = True
|
2016-04-11 05:25:56 +00:00
|
|
|
|
|
|
|
if CONFIG['MOZ_DEBUG']:
|
|
|
|
# Enable all assertions in debug builds.
|
|
|
|
DEFINES['ASSERT_LEVEL'] = 2
|
2016-10-08 09:14:49 +00:00
|
|
|
elif not CONFIG['RELEASE_OR_BETA']:
|
2016-04-11 05:25:56 +00:00
|
|
|
# Enable fast assertions in opt builds of Nightly and Aurora.
|
|
|
|
DEFINES['ASSERT_LEVEL'] = 1
|
2016-11-30 21:01:55 +00:00
|
|
|
|
|
|
|
# clang-cl's <intrin.h> doesn't work the same as MSVC's. For details, see:
|
|
|
|
#
|
|
|
|
# http://lists.llvm.org/pipermail/cfe-dev/2016-September/050943.html
|
|
|
|
#
|
|
|
|
# As a temporary workaround while upstream decides how to address this,
|
|
|
|
# we enable modules to make <intrin.h> more MSVC-compatible.
|
|
|
|
if CONFIG['CLANG_CL']:
|
|
|
|
CFLAGS += [
|
|
|
|
'-Xclang',
|
|
|
|
'-fmodules',
|
|
|
|
'-Xclang',
|
|
|
|
'-fmodules-cache-path=' + TOPOBJDIR + '/media/ffpvx',
|
|
|
|
'-fbuiltin-module-map',
|
|
|
|
]
|