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 (d8847129d134)

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
# -*- 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/.

include('sources.mozbuild')

EXPORTS.vpx += files['EXPORTS']

if CONFIG['VPX_NEED_OBJ_INT_EXTRACT']:
    HOST_SOURCES += [
        'build/make/obj_int_extract.c',
    ]

    HostProgram('host_obj_int_extract')

# Unify fewer files together to reduce the chance of name collision
FILES_PER_UNIFIED_FILE = 8

SOURCES += files['SOURCES']
UNIFIED_SOURCES += files['UNIFIED_SOURCES']

if CONFIG['MOZ_VPX_ERROR_CONCEALMENT']:
    SOURCES += files['ERROR_CONCEALMENT']

if CONFIG['VPX_X86_ASM'] and CONFIG['OS_TARGET'] == 'WINNT':
    offset_sources = [
        'vp8/encoder/vp8_asm_enc_offsets.c',
        'vpx_scale/vpx_scale_asm_offsets.c',
    ]
    SOURCES += offset_sources
    # Bug 934984 - MSVC bustage when /GL is specified
    if CONFIG['_MSC_VER']:
        for s in offset_sources:
            SOURCES[s].flags += ['-GL-']

if CONFIG['VPX_X86_ASM']:
    SOURCES += files['X86_ASM']

    if '64' in CONFIG['OS_TEST']:
        SOURCES += files['X86-64_ASM']

    # AVX2 only supported on
    # Darwin and mingw toolchains right now
    if CONFIG['OS_TARGET'] == 'Darwin' or (CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['GNU_CC']):
        SOURCES += files['AVX2']

    #postproc is only enabled on x86 with asm
    SOURCES += files['VP8_POSTPROC']

arm_asm_files = []
if CONFIG['VPX_ARM_ASM']:
    arm_asm_files += files['ARM_ASM']

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

    for f in SOURCES:
        if f.endswith('.c') and 'neon' in f:
            SOURCES[f].flags += ['-march=armv7-a', '-mthumb', '-mfloat-abi=softfp', '-mfpu=neon']

# boolhuff_armv5te.asm defines the same functions as boolhuff.c instead of
# using RTCD, so we have to make sure we only add one of the two.
if 'vp8/encoder/arm/armv5te/boolhuff_armv5te.asm' not in arm_asm_files:
    SOURCES += [
        'vp8/encoder/boolhuff.c',
    ]

MSVC_ENABLE_PGO = True

if CONFIG['GKMEDIAS_SHARED_LIBRARY']:
    NO_VISIBILITY_FLAGS = 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' in f:
                SOURCES[f].flags += CONFIG['SSE2_FLAGS']
            if 'ssse3' in f:
                SOURCES[f].flags += ['-mssse3']
            if 'sse4' in f:
                SOURCES[f].flags += ['-msse4.1']
            if 'avx2' in f:
                SOURCES[f].flags += ['-mavx2']

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