DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (d38398e5144e)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
# -*- 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/.

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

include('sources.mozbuild')

if CONFIG['VPX_USE_YASM']:
    USE_YASM = True

# Linux, Mac and Win share file lists for x86* but not configurations.
if CONFIG['CPU_ARCH'] == 'x86_64':
    EXPORTS.vpx += files['X64_EXPORTS']
    SOURCES += files['X64_SOURCES']
    if CONFIG['OS_TARGET'] == 'WINNT':
        ASFLAGS += [ '-I%s/media/libvpx/config/win/x64/' % TOPSRCDIR ]
        CFLAGS += [ '-I%s/media/libvpx/config/win/x64/' % TOPSRCDIR ]
    elif CONFIG['OS_TARGET'] == 'Darwin':
        ASFLAGS += [ '-I%s/media/libvpx/config/mac/x64/' % TOPSRCDIR ]
        CFLAGS += [ '-I%s/media/libvpx/config/mac/x64/' % TOPSRCDIR ]
    else: # Android, Linux, BSDs, etc.
        ASFLAGS += [ '-I%s/media/libvpx/config/linux/x64/' % TOPSRCDIR ]
        CFLAGS += [ '-I%s/media/libvpx/config/linux/x64/' % TOPSRCDIR ]
elif CONFIG['CPU_ARCH'] == 'x86':
    EXPORTS.vpx += files['IA32_EXPORTS']
    SOURCES += files['IA32_SOURCES']
    if CONFIG['OS_TARGET'] == 'WINNT':
        ASFLAGS += [ '-I%s/media/libvpx/config/win/ia32/' % TOPSRCDIR ]
        CFLAGS += [ '-I%s/media/libvpx/config/win/ia32/' % TOPSRCDIR ]
    elif CONFIG['OS_TARGET'] == 'Darwin':
        ASFLAGS += [ '-I%s/media/libvpx/config/mac/ia32/' % TOPSRCDIR ]
        CFLAGS += [ '-I%s/media/libvpx/config/mac/ia32/' % TOPSRCDIR ]
    else: # Android, Linux, BSDs, etc.
        ASFLAGS += [ '-I%s/media/libvpx/config/linux/ia32/' % TOPSRCDIR ]
        CFLAGS += [ '-I%s/media/libvpx/config/linux/ia32/' % TOPSRCDIR ]
elif CONFIG['CPU_ARCH'] == 'arm':
    EXPORTS.vpx += files['ARM_EXPORTS']
    ASFLAGS += [
        '-I%s/media/libvpx/config/linux/arm/' % TOPSRCDIR,
        '-I%s/libvpx' % OBJDIR,
    ]
    CFLAGS += [ '-I%s/media/libvpx/config/linux/arm/' % TOPSRCDIR ]

    arm_asm_files = files['ARM_SOURCES']

    if CONFIG['VPX_AS_CONVERSION']:
        SOURCES += sorted([
            "!%s.S" % f if f.endswith('.asm') else f for f in arm_asm_files
        ])
    else:
        SOURCES += sorted(arm_asm_files)

    for f in SOURCES:
        if f.endswith('.c') and 'neon' in f:
            SOURCES[f].flags += CONFIG['VPX_ASFLAGS']

    if CONFIG['OS_TARGET'] == 'Android':
        # For cpu-features.h
        LOCAL_INCLUDES += [
            '%%%s/sources/android/cpufeatures' % CONFIG['ANDROID_NDK'],
        ]
    if CONFIG['CLANG_CXX']:
        ASFLAGS += [
            '-no-integrated-as',
        ]
else:
    # Generic C-only configuration
    EXPORTS.vpx += files['GENERIC_EXPORTS']
    SOURCES += files['GENERIC_SOURCES']
    ASFLAGS += [ '-I%s/media/libvpx/config/generic/' % TOPSRCDIR ]
    CFLAGS += [ '-I%s/media/libvpx/config/generic/' % TOPSRCDIR ]

# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True

FINAL_LIBRARY = 'gkmedias'

DEFINES['HAVE_CONFIG_H'] = 'vpx_config.h'

if CONFIG['OS_TARGET'] == 'Android':
    # Older versions of the Android NDK don't pre-define anything to indicate
    # the OS they're on, so do it for them.
    DEFINES['__linux__'] = True

    if not CONFIG['MOZ_WEBRTC']:
        SOURCES += [
            '%%%s/sources/android/cpufeatures/cpu-features.c' % CONFIG['ANDROID_NDK'],
        ]

if CONFIG['CLANG_CL'] or not CONFIG['_MSC_VER']:
    for f in SOURCES:
        if f.endswith('.c'):
            if 'sse2.c' in f:
                SOURCES[f].flags += CONFIG['SSE2_FLAGS']
            if 'ssse3.c' in f:
                SOURCES[f].flags += ['-mssse3']
            if 'sse4.c' in f:
                SOURCES[f].flags += ['-msse4.1']
            if 'avx.c' in f:
                SOURCES[f].flags += ['-mavx']
            if 'avx2.c' in f:
                SOURCES[f].flags += ['-mavx2']

# Suppress warnings in third-party code.
if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
    CFLAGS += [
        '-Wno-sign-compare',
        '-Wno-unused-function', # so many of these warnings; just ignore them
    ]
if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']:
    CFLAGS += [
        '-Wno-unreachable-code',
        '-Wno-unneeded-internal-declaration',
    ]

ASFLAGS += CONFIG['VPX_ASFLAGS']
ASFLAGS += [
    '-I.',
    '-I%s/media/libvpx/libvpx' % TOPSRCDIR,
]

CFLAGS += [
    '-I%s/media/libvpx/libvpx' % TOPSRCDIR,
    '-I%s/media/libvpx/config' % TOPSRCDIR, # vpx_version.h
]

if CONFIG['OS_TARGET'] == 'Android':
    # For LIBVPX_RAND
    ASFLAGS += [
        '-D__ANDROID__'
    ]