michael@0: # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- michael@0: # vim: set filetype=python: michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: include('sources.mozbuild') michael@0: michael@0: EXPORTS.vpx += files['EXPORTS'] michael@0: michael@0: if CONFIG['VPX_NEED_OBJ_INT_EXTRACT']: michael@0: HOST_SOURCES += [ michael@0: 'build/make/obj_int_extract.c', michael@0: ] michael@0: michael@0: HOST_PROGRAM = 'host_obj_int_extract' michael@0: michael@0: # Unify fewer files together to reduce the chance of name collision michael@0: FILES_PER_UNIFIED_FILE = 8 michael@0: michael@0: SOURCES += files['SOURCES'] michael@0: UNIFIED_SOURCES += files['UNIFIED_SOURCES'] michael@0: michael@0: if CONFIG['MOZ_VPX_ERROR_CONCEALMENT']: michael@0: SOURCES += files['ERROR_CONCEALMENT'] michael@0: michael@0: if CONFIG['VPX_X86_ASM'] and CONFIG['OS_TARGET'] == 'WINNT': michael@0: offset_sources = [ michael@0: 'vp8/encoder/vp8_asm_enc_offsets.c', michael@0: 'vpx_scale/vpx_scale_asm_offsets.c', michael@0: ] michael@0: SOURCES += offset_sources michael@0: if CONFIG['_MSC_VER']: michael@0: for s in offset_sources: michael@0: SOURCES[s].no_pgo = True michael@0: michael@0: if CONFIG['VPX_X86_ASM']: michael@0: SOURCES += files['X86_ASM'] michael@0: michael@0: if '64' in CONFIG['OS_TEST']: michael@0: SOURCES += files['X86-64_ASM'] michael@0: michael@0: # AVX2 only supported on michael@0: # Darwin toolchain right now michael@0: if CONFIG['OS_TARGET'] == 'Darwin': michael@0: SOURCES += files['AVX2'] michael@0: michael@0: #postproc is only enabled on x86 with asm michael@0: SOURCES += files['VP8_POSTPROC'] michael@0: michael@0: arm_asm_files = [] michael@0: if CONFIG['VPX_ARM_ASM']: michael@0: arm_asm_files += files['ARM_ASM'] michael@0: michael@0: if CONFIG['VPX_AS_CONVERSION']: michael@0: GENERATED_SOURCES += [ "%s.%s" % (f, CONFIG['VPX_ASM_SUFFIX']) michael@0: for f in sorted(arm_asm_files) if f.endswith('.asm') michael@0: ] michael@0: SOURCES += [ michael@0: f for f in sorted(arm_asm_files) if not f.endswith('.asm') michael@0: ] michael@0: else: michael@0: SOURCES += sorted(arm_asm_files) michael@0: michael@0: # boolhuff_armv5te.asm defines the same functions as boolhuff.c instead of michael@0: # using RTCD, so we have to make sure we only add one of the two. michael@0: if 'vp8/encoder/arm/armv5te/boolhuff_armv5te.asm' not in arm_asm_files: michael@0: SOURCES += [ michael@0: 'vp8/encoder/boolhuff.c', michael@0: ] michael@0: michael@0: MSVC_ENABLE_PGO = True michael@0: michael@0: if CONFIG['GKMEDIAS_SHARED_LIBRARY']: michael@0: NO_VISIBILITY_FLAGS = True michael@0: michael@0: FINAL_LIBRARY = 'gkmedias' michael@0: michael@0: DEFINES['HAVE_CONFIG_H'] = 'vpx_config.h' michael@0: michael@0: if CONFIG['OS_TARGET'] == 'Android': michael@0: # Older versions of the Android NDK don't pre-define anything to indicate michael@0: # the OS they're on, so do it for them. michael@0: DEFINES['__linux__'] = True michael@0: michael@0: if not CONFIG['MOZ_WEBRTC']: michael@0: SOURCES += [ michael@0: '%s/sources/android/cpufeatures/cpu-features.c' % CONFIG['ANDROID_NDK'], michael@0: ] michael@0: michael@0: if not CONFIG['_MSC_VER']: michael@0: for f in SOURCES: michael@0: if f.endswith('.c'): michael@0: if 'sse2' in f: michael@0: SOURCES[f].flags += CONFIG['SSE2_FLAGS'] michael@0: if 'ssse3' in f: michael@0: SOURCES[f].flags += ['-mssse3'] michael@0: if 'avx2' in f: michael@0: SOURCES[f].flags += ['-mavx2'] michael@0: michael@0: # Suppress warnings in third-party code. michael@0: if CONFIG['GNU_CC']: michael@0: CFLAGS += ['-Wno-sign-compare']