2013-04-01 22:36:59 +04:00
|
|
|
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
|
2013-02-26 00:47:22 +04: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/.
|
|
|
|
|
2015-03-03 22:36:00 +03:00
|
|
|
with Files('*'):
|
|
|
|
BUG_COMPONENT = ('Core', 'Video/Audio')
|
|
|
|
|
2013-12-06 15:19:00 +04:00
|
|
|
include('sources.mozbuild')
|
|
|
|
|
|
|
|
EXPORTS.vpx += files['EXPORTS']
|
2013-04-16 23:24:43 +04:00
|
|
|
|
2013-12-09 16:49:00 +04:00
|
|
|
SOURCES += files['SOURCES']
|
2013-08-22 10:56:02 +04:00
|
|
|
|
2013-12-06 17:16:00 +04:00
|
|
|
if CONFIG['MOZ_VPX_ERROR_CONCEALMENT']:
|
2013-12-06 15:19:00 +04:00
|
|
|
SOURCES += files['ERROR_CONCEALMENT']
|
2013-11-29 18:02:00 +04:00
|
|
|
|
|
|
|
if CONFIG['VPX_X86_ASM']:
|
2013-12-06 15:19:00 +04:00
|
|
|
SOURCES += files['X86_ASM']
|
2013-11-29 18:02:00 +04:00
|
|
|
|
|
|
|
if '64' in CONFIG['OS_TEST']:
|
2013-12-06 15:19:00 +04:00
|
|
|
SOURCES += files['X86-64_ASM']
|
2013-11-29 18:02:00 +04:00
|
|
|
|
2015-07-16 12:37:00 +03:00
|
|
|
#avx2 can be enabled on all supported compilters
|
|
|
|
SOURCES += files['AVX2']
|
2013-11-29 18:02:00 +04:00
|
|
|
|
2013-12-06 17:16:00 +04:00
|
|
|
#postproc is only enabled on x86 with asm
|
|
|
|
SOURCES += files['VP8_POSTPROC']
|
2013-11-29 18:02:00 +04:00
|
|
|
|
|
|
|
arm_asm_files = []
|
|
|
|
if CONFIG['VPX_ARM_ASM']:
|
2013-12-06 15:19:00 +04:00
|
|
|
arm_asm_files += files['ARM_ASM']
|
2013-11-29 18:02:00 +04:00
|
|
|
|
|
|
|
if CONFIG['VPX_AS_CONVERSION']:
|
2015-05-19 11:41:09 +03:00
|
|
|
SOURCES += sorted([
|
|
|
|
"!%s.%s" % (f, CONFIG['VPX_ASM_SUFFIX'])
|
|
|
|
if f.endswith('.asm') else f
|
|
|
|
for f in sorted(arm_asm_files)
|
|
|
|
])
|
2013-11-29 18:02:00 +04:00
|
|
|
else:
|
|
|
|
SOURCES += sorted(arm_asm_files)
|
|
|
|
|
2014-11-07 01:50:42 +03:00
|
|
|
for f in SOURCES:
|
|
|
|
if f.endswith('.c') and 'neon' in f:
|
2015-08-15 02:53:54 +03:00
|
|
|
SOURCES[f].flags += CONFIG['VPX_ASFLAGS']
|
2014-11-07 01:50:42 +03:00
|
|
|
|
2013-11-29 18:02:00 +04:00
|
|
|
# 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.
|
2013-12-06 17:16:00 +04:00
|
|
|
if 'vp8/encoder/arm/armv5te/boolhuff_armv5te.asm' not in arm_asm_files:
|
2013-11-29 18:02:00 +04:00
|
|
|
SOURCES += [
|
|
|
|
'vp8/encoder/boolhuff.c',
|
|
|
|
]
|
|
|
|
|
2015-10-20 04:05:20 +03:00
|
|
|
# We allow warnings for third-party code that can be updated from upstream.
|
2015-08-28 06:44:53 +03:00
|
|
|
ALLOW_COMPILER_WARNINGS = True
|
|
|
|
|
2013-11-19 06:47:14 +04:00
|
|
|
FINAL_LIBRARY = 'gkmedias'
|
2013-11-27 17:55:07 +04:00
|
|
|
|
|
|
|
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
|
2014-01-09 23:43:29 +04:00
|
|
|
|
|
|
|
if not CONFIG['MOZ_WEBRTC']:
|
|
|
|
SOURCES += [
|
|
|
|
'%s/sources/android/cpufeatures/cpu-features.c' % CONFIG['ANDROID_NDK'],
|
|
|
|
]
|
2014-03-06 02:00:52 +04:00
|
|
|
|
2014-12-18 18:31:46 +03:00
|
|
|
if CONFIG['CLANG_CL'] or not CONFIG['_MSC_VER']:
|
2014-03-06 02:00:52 +04:00
|
|
|
for f in SOURCES:
|
|
|
|
if f.endswith('.c'):
|
|
|
|
if 'sse2' in f:
|
2014-03-20 05:55:00 +04:00
|
|
|
SOURCES[f].flags += CONFIG['SSE2_FLAGS']
|
2014-03-06 02:00:52 +04:00
|
|
|
if 'ssse3' in f:
|
|
|
|
SOURCES[f].flags += ['-mssse3']
|
2014-10-30 07:47:43 +03:00
|
|
|
if 'sse4' in f:
|
|
|
|
SOURCES[f].flags += ['-msse4.1']
|
2014-03-06 02:00:52 +04:00
|
|
|
if 'avx2' in f:
|
|
|
|
SOURCES[f].flags += ['-mavx2']
|
2014-03-16 10:21:32 +04:00
|
|
|
|
|
|
|
# Suppress warnings in third-party code.
|
|
|
|
if CONFIG['GNU_CC']:
|
|
|
|
CFLAGS += ['-Wno-sign-compare']
|
2015-05-08 08:13:10 +03:00
|
|
|
|
|
|
|
ASFLAGS += CONFIG['VPX_ASFLAGS']
|
|
|
|
ASFLAGS += [
|
|
|
|
'-I.',
|
|
|
|
'-I%s/media/libvpx/' % TOPSRCDIR,
|
|
|
|
'-I%s/media/libvpx/vpx_ports/' % TOPSRCDIR,
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['OS_TARGET'] == 'Android':
|
|
|
|
# For LIBVPX_RAND
|
|
|
|
ASFLAGS += [
|
|
|
|
'-D__ANDROID__'
|
|
|
|
]
|