2017-04-13 03:01:43 +03:00
|
|
|
# -*- 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', 'Audio/Video')
|
|
|
|
|
|
|
|
include('sources.mozbuild')
|
|
|
|
|
|
|
|
# Linux, Mac and Win share file lists for x86* but not configurations.
|
|
|
|
if CONFIG['CPU_ARCH'] == 'x86_64':
|
|
|
|
EXPORTS.aom += files['X64_EXPORTS']
|
|
|
|
SOURCES += files['X64_SOURCES']
|
2017-05-12 01:31:50 +03:00
|
|
|
USE_YASM = True
|
2017-04-13 03:01:43 +03:00
|
|
|
if CONFIG['OS_TARGET'] == 'WINNT':
|
2019-10-10 21:30:56 +03:00
|
|
|
ASFLAGS += [ '-I%s/media/libaom/config/win/x64/' % TOPSRCDIR ]
|
|
|
|
LOCAL_INCLUDES += [ '/media/libaom/config/win/x64/' ]
|
|
|
|
EXPORTS.aom += [ 'config/win/x64/config/aom_config.h' ]
|
|
|
|
# This code is not included in our PGO profile, and pointlessly
|
|
|
|
# PGO-optimizing it slows down our builds a lot.
|
|
|
|
NO_PGO = True
|
2017-04-13 03:01:43 +03:00
|
|
|
elif CONFIG['OS_TARGET'] == 'Darwin':
|
|
|
|
ASFLAGS += [ '-I%s/media/libaom/config/mac/x64/' % TOPSRCDIR ]
|
2017-09-14 13:39:27 +03:00
|
|
|
LOCAL_INCLUDES += [ '/media/libaom/config/mac/x64/' ]
|
2018-06-05 19:47:09 +03:00
|
|
|
EXPORTS.aom += [ 'config/mac/x64/config/aom_config.h' ]
|
2017-04-13 03:01:43 +03:00
|
|
|
else: # Android, Linux, BSDs, etc.
|
|
|
|
ASFLAGS += [ '-I%s/media/libaom/config/linux/x64/' % TOPSRCDIR ]
|
2017-09-14 13:39:27 +03:00
|
|
|
LOCAL_INCLUDES += [ '/media/libaom/config/linux/x64/' ]
|
2018-06-05 19:47:09 +03:00
|
|
|
EXPORTS.aom += [ 'config/linux/x64/config/aom_config.h' ]
|
2017-04-13 03:01:43 +03:00
|
|
|
elif CONFIG['CPU_ARCH'] == 'x86':
|
|
|
|
EXPORTS.aom += files['IA32_EXPORTS']
|
|
|
|
SOURCES += files['IA32_SOURCES']
|
2017-05-12 01:31:50 +03:00
|
|
|
USE_YASM = True
|
2017-04-13 03:01:43 +03:00
|
|
|
if CONFIG['OS_TARGET'] == 'WINNT':
|
2019-10-10 21:30:56 +03:00
|
|
|
ASFLAGS += [ '-I%s/media/libaom/config/win/ia32/' % TOPSRCDIR ]
|
|
|
|
LOCAL_INCLUDES += [ '/media/libaom/config/win/ia32/' ]
|
|
|
|
EXPORTS.aom += [ 'config/win/ia32/config/aom_config.h' ]
|
|
|
|
NO_PGO = True # Compiler OOMs, bug 1445922
|
2017-04-13 03:01:43 +03:00
|
|
|
else: # Android, Linux, BSDs, etc.
|
|
|
|
ASFLAGS += [ '-I%s/media/libaom/config/linux/ia32/' % TOPSRCDIR ]
|
2017-09-14 13:39:27 +03:00
|
|
|
LOCAL_INCLUDES += [ '/media/libaom/config/linux/ia32/' ]
|
2018-06-05 19:47:09 +03:00
|
|
|
EXPORTS.aom += [ 'config/linux/ia32/config/aom_config.h' ]
|
2017-04-13 03:01:43 +03:00
|
|
|
elif CONFIG['CPU_ARCH'] == 'arm':
|
|
|
|
EXPORTS.aom += files['ARM_EXPORTS']
|
|
|
|
ASFLAGS += [
|
|
|
|
'-I%s/media/libaom/config/linux/arm/' % TOPSRCDIR,
|
|
|
|
'-I%s/libaom' % OBJDIR,
|
|
|
|
]
|
2017-09-14 13:39:27 +03:00
|
|
|
LOCAL_INCLUDES += [ '/media/libaom/config/linux/arm/' ]
|
2018-06-05 19:47:09 +03:00
|
|
|
EXPORTS.aom += [ 'config/linux/arm/config/aom_config.h' ]
|
2017-04-13 03:01:43 +03:00
|
|
|
|
2018-12-19 14:12:11 +03:00
|
|
|
SOURCES += files['ARM_SOURCES']
|
2017-04-13 03:01:43 +03:00
|
|
|
|
|
|
|
for f in SOURCES:
|
|
|
|
if f.endswith('neon.c'):
|
|
|
|
SOURCES[f].flags += CONFIG['VPX_ASFLAGS']
|
|
|
|
|
|
|
|
if CONFIG['OS_TARGET'] == 'Android':
|
|
|
|
# For cpu-features.h
|
|
|
|
LOCAL_INCLUDES += [
|
|
|
|
'%%%s/sources/android/cpufeatures' % CONFIG['ANDROID_NDK'],
|
|
|
|
]
|
2017-12-08 00:09:38 +03:00
|
|
|
if CONFIG['CC_TYPE'] == 'clang':
|
2017-04-13 03:01:43 +03:00
|
|
|
ASFLAGS += [
|
|
|
|
'-no-integrated-as',
|
|
|
|
]
|
|
|
|
else:
|
|
|
|
# Generic C-only configuration
|
|
|
|
EXPORTS.aom += files['GENERIC_EXPORTS']
|
|
|
|
SOURCES += files['GENERIC_SOURCES']
|
|
|
|
ASFLAGS += [ '-I%s/media/libaom/config/generic/' % TOPSRCDIR ]
|
2017-09-14 13:39:27 +03:00
|
|
|
LOCAL_INCLUDES += [ '/media/libaom/config/generic/' ]
|
2018-06-05 19:47:09 +03:00
|
|
|
EXPORTS.aom += [ 'config/generic/config/aom_config.h' ]
|
2017-04-13 03:01:43 +03:00
|
|
|
|
|
|
|
# We allow warnings for third-party code that can be updated from upstream.
|
2017-10-26 01:12:09 +03:00
|
|
|
AllowCompilerWarnings()
|
2017-04-13 03:01:43 +03:00
|
|
|
|
|
|
|
FINAL_LIBRARY = 'gkmedias'
|
|
|
|
|
|
|
|
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'],
|
|
|
|
]
|
|
|
|
|
2019-02-15 00:45:27 +03:00
|
|
|
for f in SOURCES:
|
|
|
|
if f.endswith('sse2.c'):
|
|
|
|
SOURCES[f].flags += CONFIG['SSE2_FLAGS']
|
|
|
|
elif f.endswith('ssse3.c'):
|
|
|
|
SOURCES[f].flags += ['-mssse3']
|
|
|
|
elif f.endswith('sse4.c'):
|
|
|
|
SOURCES[f].flags += ['-msse4.1']
|
|
|
|
elif f.endswith('sse42.c'):
|
|
|
|
SOURCES[f].flags += ['-msse4.2']
|
|
|
|
elif f.endswith('avx.c'):
|
|
|
|
SOURCES[f].flags += ['-mavx']
|
|
|
|
elif f.endswith('avx2.c'):
|
|
|
|
SOURCES[f].flags += ['-mavx2']
|
2017-06-07 22:34:31 +03:00
|
|
|
|
2017-04-13 03:01:43 +03:00
|
|
|
# Suppress warnings in third-party code.
|
2019-02-15 00:45:27 +03:00
|
|
|
CFLAGS += [
|
|
|
|
'-Wno-sign-compare',
|
|
|
|
'-Wno-unused-function', # so many of these warnings; just ignore them
|
|
|
|
]
|
2017-12-08 00:10:19 +03:00
|
|
|
if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
|
2017-04-13 03:01:43 +03:00
|
|
|
CFLAGS += [
|
|
|
|
'-Wno-unreachable-code',
|
|
|
|
'-Wno-unneeded-internal-declaration',
|
|
|
|
]
|
|
|
|
|
|
|
|
ASFLAGS += CONFIG['VPX_ASFLAGS']
|
|
|
|
ASFLAGS += [
|
2018-11-16 04:20:58 +03:00
|
|
|
'-I./',
|
|
|
|
'-I%s/third_party/aom/' % TOPSRCDIR,
|
2017-04-13 03:01:43 +03:00
|
|
|
]
|
|
|
|
|
2017-09-14 13:39:27 +03:00
|
|
|
LOCAL_INCLUDES += [
|
|
|
|
'/media/libaom/config', # aom_version.h
|
|
|
|
'/third_party/aom',
|
2017-04-13 03:01:43 +03:00
|
|
|
]
|
2018-09-06 13:25:28 +03:00
|
|
|
|
|
|
|
if CONFIG['OS_TARGET'] == 'Linux':
|
|
|
|
# For fuzzing, We only support building on Linux currently.
|
|
|
|
include('/tools/fuzzing/libfuzzer-config.mozbuild')
|
|
|
|
if CONFIG['FUZZING_INTERFACES']:
|
|
|
|
TEST_DIRS += [
|
|
|
|
'test/fuzztest'
|
|
|
|
]
|