media/libcubeb/src/moz.build
author Gurzau Raul <rgurzau@mozilla.com>
Sat, 14 Dec 2019 04:17:50 +0200
changeset 506933 a6b449010a04a134102052a08639a51b13f576d2
parent 502123 58992c594ec72fb65591fe9088e207ef9e6e8cb1
permissions -rw-r--r--
No bug: [taskgraph] Simplify upload_symbols logic. -fixed typo a=tomprince

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

DEFINES['CUBEB_GECKO_BUILD'] = True

Library('cubeb')

SOURCES += [
    'cubeb.c',
    'cubeb_log.cpp',
    'cubeb_mixer.cpp',
    'cubeb_panner.cpp',
    'cubeb_strings.c',
    'cubeb_utils.cpp'
]

if CONFIG['MOZ_ALSA']:
    SOURCES += [
        'cubeb_alsa.c',
    ]
    DEFINES['USE_ALSA'] = True

if CONFIG['MOZ_PULSEAUDIO'] or CONFIG['MOZ_JACK']:
    SOURCES += [
        'cubeb_resampler.cpp',
    ]

if CONFIG['MOZ_PULSEAUDIO']:
    SOURCES += [
        'cubeb_pulse.c',
    ]
    DEFINES['USE_PULSE'] = True
    DEFINES['USE_PULSE_RUST'] = True

if CONFIG['MOZ_JACK']:
    SOURCES += [
        'cubeb_jack.cpp',
    ]
    USE_LIBS += [
        'speex',
    ]
    DEFINES['USE_JACK'] = True

if CONFIG['OS_ARCH'] == 'OpenBSD':
    SOURCES += [
        'cubeb_sndio.c',
    ]
    DEFINES['USE_SNDIO'] = True
    DEFINES['DISABLE_LIBSNDIO_DLOPEN'] = True

if CONFIG['OS_TARGET'] == 'Darwin':
    SOURCES += [
        'cubeb_audiounit.cpp',
        'cubeb_resampler.cpp'
    ]
    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
        SOURCES += [
            'cubeb_osx_run_loop.c',
        ]
    DEFINES['USE_AUDIOUNIT'] = True
    if CONFIG['MOZ_AUDIOUNIT_RUST']:
        DEFINES['USE_AUDIOUNIT_RUST'] = True

if CONFIG['OS_TARGET'] == 'WINNT':
    SOURCES += [
        'cubeb_resampler.cpp',
        'cubeb_wasapi.cpp',
        'cubeb_winmm.c',
    ]
    DEFINES['USE_WINMM'] = True
    DEFINES['USE_WASAPI'] = True
    OS_LIBS += [
      "avrt",
    ]
    if CONFIG['CC_TYPE'] == 'clang-cl':
        CXXFLAGS += ['-Wno-macro-redefined'] # '_USE_MATH_DEFINES' : macro redefinition

if CONFIG['OS_TARGET'] == 'Android':
    SOURCES += ['cubeb_opensl.c']
    SOURCES += ['cubeb_resampler.cpp']
    SOURCES += ['cubeb-jni.cpp']
    DEFINES['USE_OPENSL'] = True
    SOURCES += [
        'cubeb_audiotrack.c',
    ]
    DEFINES['USE_AUDIOTRACK'] = True

FINAL_LIBRARY = 'gkmedias'

CFLAGS += CONFIG['MOZ_ALSA_CFLAGS']
CFLAGS += CONFIG['MOZ_JACK_CFLAGS']
CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS']

# We allow warnings for third-party code that can be updated from upstream.
AllowCompilerWarnings()