Bumping manifests a=b2g-bump
[gecko.git] / media / libopus / moz.build
blob2607a1965e50bed116364292df54419c2d90190c
1 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 EXPORTS.opus += [
8     'include/opus.h',
9     'include/opus_defines.h',
10     'include/opus_multistream.h',
11     'include/opus_types.h',
14 MSVC_ENABLE_PGO = True
16 FINAL_LIBRARY = 'gkmedias'
18 DEFINES['OPUS_BUILD'] = True
19 DEFINES['OPUS_VERSION'] = '"v1.1-mozilla"'
20 DEFINES['USE_ALLOCA'] = True
22 # We only need to export symbols if we're built into libgkmedias
23 # instead of libxul.
24 if not CONFIG['GKMEDIAS_SHARED_LIBRARY']:
25     DEFINES['OPUS_EXPORT'] = ''
27 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
28     DEFINES['OPUS_ARM_ASM'] = True
29     DEFINES['OPUS_ARM_EXTERNAL_ASM'] = True
30     DEFINES['OPUS_ARM_INLINE_ASM'] = True
31     if int(CONFIG['ARM_ARCH']) >= 6:
32         DEFINES['OPUS_ARM_INLINE_EDSP'] = True
33         DEFINES['OPUS_ARM_MAY_HAVE_EDSP'] = True
34         DEFINES['OPUS_ARM_MAY_HAVE_MEDIA'] = True
35         DEFINES['OPUS_ARM_MAY_HAVE_NEON'] = True
37 if CONFIG['MOZ_DEBUG']:
38     DEFINES['ENABLE_ASSERTIONS'] = True
40 if CONFIG['OS_ARCH'] in ('Linux', 'Darwin', 'DragonFly', 'FreeBSD',
41                          'NetBSD', 'OpenBSD'):
42     DEFINES['HAVE_LRINTF'] = True
44 if CONFIG['OS_ARCH'] == 'WINNT':
45     DEFINES['inline'] = '__inline'
46     if CONFIG['GNU_CC']:
47         DEFINES['HAVE_LRINTF'] = True
49 if CONFIG['OS_ARCH'] == 'AIX':
50     DEFINES['alloca'] = '__alloca'
52 if CONFIG['OS_ARCH'] == 'SunOS':
53     DEFINES['HAVE_ALLOCA_H'] = True
55 if not CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
56     DEFINES['FIXED_POINT'] = 1
57     DEFINES['DISABLE_FLOAT_API'] = True
59 LOCAL_INCLUDES += [
60     'celt',
61     'include',
62     'silk',
63     'src',
66 # sources.mozbuild is generated from gen-sources.py when a new libopus is
67 # imported.
68 include('sources.mozbuild')
70 SOURCES += celt_sources
71 SOURCES += silk_sources
72 SOURCES += opus_sources
74 if CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
75     LOCAL_INCLUDES += [
76         'silk/float',
77     ]
78     SOURCES += silk_sources_float
79     SOURCES += opus_sources_float
80 else:
81     LOCAL_INCLUDES += [
82         'silk/fixed',
83     ]
84     SOURCES += silk_sources_fixed
86 if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['GNU_AS']:
87     SOURCES += celt_sources_arm
88     GENERATED_SOURCES += [ '%s.%s' % (f, CONFIG['ASM_SUFFIX']) for f in [
89         'celt_pitch_xcorr_arm-gnu',
90     ]]
91     # -Os is significantly slower, enable -O3 unless optimization is disabled
92     if CONFIG['MOZ_OPTIMIZE']:
93       CFLAGS += [
94         '-O3',
95       ]
96       CXXFLAGS += [
97         '-O3',
98       ]
100 # Suppress warnings in third-party code.
101 if CONFIG['GNU_CC']:
102     CFLAGS += ['-Wno-declaration-after-statement']
103     if CONFIG['CLANG_CXX']:
104         CFLAGS += ['-Wno-\#pragma-messages']