media/ffvpx/ffvpxcommon.mozbuild
author Jared Wein <jwein@mozilla.com>
Tue, 21 Mar 2017 10:51:40 -0400
changeset 393320 b305ba0b489ba2c9ac32c6896f9da68a24e10357
parent 370009 a63ed01b4c5632a96dc0a626400b5251235c5c5f
child 410295 f0838868d07513eec9cfb94505474cc5a9b3035c
permissions -rw-r--r--
Bug 1348617 - Use the alpha channel of custom styled select backgrounds by applying the requested color on top of the system's background. r=mossop, a=gchang This matches parity with Google Chrome Canary Version 59.0.3046.0 (Official Build) canary (64-bit). MozReview-Commit-ID: 3rkhiFv8ezX

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# 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]

if CONFIG['FFVPX_ASFLAGS']:
    USE_YASM = True
    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']
            ASFLAGS += ['-Pconfig_win32.asm']
        else:
            ASFLAGS += ['-Pconfig_win64.asm']
    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
# Suppress warnings in third-party code.
if CONFIG['GNU_CC']:
    CFLAGS += [
        '-Wno-parentheses',
        '-Wno-pointer-sign',
        '-Wno-sign-compare',
        '-Wno-switch',
        '-Wno-type-limits',
        '-Wno-unused-function',
        '-Wno-deprecated-declarations',
    ]
    if CONFIG['CLANG_CXX']:
        CFLAGS += [
            '-Wno-incompatible-pointer-types-discards-qualifiers',
            '-Wno-logical-op-parentheses',
        ]
    # Force visibility of cpu and av_log symbols.
    CFLAGS += ['-include', 'libavutil_visibility.h']
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
        # 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

if CONFIG['MOZ_DEBUG']:
    # Enable all assertions in debug builds.
    DEFINES['ASSERT_LEVEL'] = 2
elif not CONFIG['RELEASE_OR_BETA']:
    # Enable fast assertions in opt builds of Nightly and Aurora.
    DEFINES['ASSERT_LEVEL'] = 1

# 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',
    ]