media/libtheora/moz.build
author Nicholas Nethercote <nnethercote@mozilla.com>
Thu, 27 Aug 2015 20:44:53 -0700
changeset 282279 c646a88160d7b65f755f4dcfa5dec8626a77bcd5
parent 265866 bd8f1e56cdaf9888d001a3cfba706e4d1b794a66
child 291941 92eb00ee19771b8ea7027d10acec971430a69143
permissions -rw-r--r--
Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium. The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in code we control and which should be removable with a little effort.

# -*- Mode: python; c-basic-offset: 4; 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/.

with Files('*'):
    BUG_COMPONENT = ('Core', 'Video/Audio')

EXPORTS.theora += [
    'include/theora/codec.h',
    'include/theora/theoradec.h',
    'include/theora/theoraenc.h',
]

ALLOW_COMPILER_WARNINGS = True

FINAL_LIBRARY = 'gkmedias'

if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
    NO_VISIBILITY_FLAGS = True

# The encoder is currently not included.
DEFINES['THEORA_DISABLE_ENCODE'] = True

# Suppress warnings in third-party code.
if CONFIG['GNU_CC']:
    CFLAGS += ['-Wno-type-limits']
    if CONFIG['CLANG_CXX']:
        CFLAGS += ['-Wno-tautological-compare']

UNIFIED_SOURCES += [
    'lib/apiwrapper.c',
    'lib/bitpack.c',
    'lib/decapiwrapper.c',
    'lib/decinfo.c',
    'lib/decode.c',
    'lib/dequant.c',
    'lib/fragment.c',
    'lib/huffdec.c',
    'lib/idct.c',
    'lib/info.c',
    'lib/internal.c',
    'lib/quant.c',
    'lib/state.c',
]

LOCAL_INCLUDES += ['include']

if '86' in CONFIG['OS_TEST']:
    if CONFIG['OS_ARCH'] != 'SunOS':
        if CONFIG['OS_ARCH'] != 'WINNT' or CONFIG['OS_TEST'] != 'x86_64':
            DEFINES['OC_X86_ASM'] = True
            if '64' in CONFIG['OS_TEST']:
                DEFINES['OC_X86_64_ASM'] = True
    if CONFIG['_MSC_VER']:
        if '64' not in CONFIG['OS_TEST']:
            SOURCES += [
                'lib/x86_vc/mmxfrag.c',
                'lib/x86_vc/mmxidct.c',
                'lib/x86_vc/mmxstate.c',
                'lib/x86_vc/x86cpu.c',
                'lib/x86_vc/x86state.c',
            ]
    else:
        SOURCES += [
            'lib/x86/mmxfrag.c',
            'lib/x86/mmxidct.c',
            'lib/x86/mmxstate.c',
            'lib/x86/sse2idct.c',
            'lib/x86/x86cpu.c',
            'lib/x86/x86state.c',
        ]

if CONFIG['GNU_AS']:
    if 'arm' in CONFIG['OS_TEST']:
        SOURCES += [
            'lib/arm/armcpu.c',
            'lib/arm/armstate.c',
        ]
        for var in ('OC_ARM_ASM',
                    'OC_ARM_ASM_EDSP',
                    'OC_ARM_ASM_MEDIA',
                    'OC_ARM_ASM_NEON'):
            DEFINES[var] = True
        # The Android NDK doesn't pre-define anything to indicate the OS it's
        # on, so do it for them.
        if CONFIG['OS_TARGET'] == 'Android':
            DEFINES['__linux__'] = True

        SOURCES += [ '!%s.%s' % (f, CONFIG['ASM_SUFFIX']) for f in [
            'armbits-gnu',
            'armfrag-gnu',
            'armidct-gnu',
            'armloop-gnu',
        ]]

        # These flags are a lie; they're just used to enable the requisite
        # opcodes; actual arch detection is done at runtime.
        ASFLAGS += [
            '-march=armv7-a',
            '-mfpu=neon',
        ]