dom/bluetooth/moz.build
author Jamin Liu <jaliu@mozilla.com>
Fri, 21 Aug 2015 09:51:41 +0800
changeset 291242 f7e0cd74c082d5bee3493e39dea048a58af2dd59
parent 290985 fda36c6f4825ead1f23eb9711bf05aa2940590d8
child 291254 00b847293e708b261f6963563e3f7536a92d377a
permissions -rw-r--r--
Bug 1180554 - Dispatch events to PBAP event handlers when the PBAP requests comes. r=btian, r=mrbkap

# -*- Mode: python; c-basic-offset: 4; 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/.

if CONFIG['MOZ_B2G_BT']:

    #
    # Generic code
    #

    SOURCES += [
        'BluetoothHidManager.cpp',
        'BluetoothInterface.cpp',
        'BluetoothPbapRequestHandle.cpp',
        'BluetoothUtils.cpp',
        'BluetoothUuid.cpp',
        'ObexBase.cpp'
    ]

    if CONFIG['MOZ_B2G_RIL']:
        SOURCES += [
            'BluetoothRilListener.cpp'
        ]

    SOURCES += [
        'bluetooth2/BluetoothAdapter.cpp',
        'bluetooth2/BluetoothClassOfDevice.cpp',
        'bluetooth2/BluetoothDevice.cpp',
        'bluetooth2/BluetoothDiscoveryHandle.cpp',
        'bluetooth2/BluetoothGatt.cpp',
        'bluetooth2/BluetoothGattCharacteristic.cpp',
        'bluetooth2/BluetoothGattDescriptor.cpp',
        'bluetooth2/BluetoothGattServer.cpp',
        'bluetooth2/BluetoothGattService.cpp',
        'bluetooth2/BluetoothLeDeviceEvent.cpp',
        'bluetooth2/BluetoothManager.cpp',
        'bluetooth2/BluetoothPairingHandle.cpp',
        'bluetooth2/BluetoothPairingListener.cpp',
        'bluetooth2/BluetoothProfileController.cpp',
        'bluetooth2/BluetoothReplyRunnable.cpp',
        'bluetooth2/BluetoothService.cpp',
        'bluetooth2/ipc/BluetoothChild.cpp',
        'bluetooth2/ipc/BluetoothParent.cpp',
        'bluetooth2/ipc/BluetoothServiceChildProcess.cpp',
    ]
    LOCAL_INCLUDES += [
        'bluetooth2',
        'bluetooth2/ipc',
    ]

    #
    # Bluetooth backends
    #

    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
        if CONFIG['MOZ_B2G_BT_BLUEZ']:
            CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
            SOURCES += [
                'bluez/BluetoothA2dpManager.cpp',
                'bluez/BluetoothDBusService.cpp',
                'bluez/BluetoothHfpManager.cpp',
                'bluez/BluetoothOppManager.cpp',
                'bluez/BluetoothSocket.cpp',
                'bluez/BluetoothUnixSocketConnector.cpp'
            ]
            LOCAL_INCLUDES += [
                'bluez',
            ]
            DEFINES['MOZ_B2G_BT_BLUEZ'] = True
        elif CONFIG['MOZ_B2G_BT_DAEMON']:
            SOURCES += [
                'bluedroid/BluetoothA2dpManager.cpp',
                'bluedroid/BluetoothDaemonA2dpInterface.cpp',
                'bluedroid/BluetoothDaemonAvrcpInterface.cpp',
                'bluedroid/BluetoothDaemonGattInterface.cpp',
                'bluedroid/BluetoothDaemonHandsfreeInterface.cpp',
                'bluedroid/BluetoothDaemonHelpers.cpp',
                'bluedroid/BluetoothDaemonInterface.cpp',
                'bluedroid/BluetoothDaemonSetupInterface.cpp',
                'bluedroid/BluetoothDaemonSocketInterface.cpp',
                'bluedroid/BluetoothGattManager.cpp',
                'bluedroid/BluetoothOppManager.cpp',
                'bluedroid/BluetoothPbapManager.cpp',
                'bluedroid/BluetoothServiceBluedroid.cpp',
                'bluedroid/BluetoothSocket.cpp',
                'bluedroid/BluetoothSocketMessageWatcher.cpp'
            ]
            LOCAL_INCLUDES += [
                'bluedroid',
            ]

            if CONFIG['MOZ_B2G_RIL']:
                SOURCES += [
                    'bluedroid/hfp/BluetoothHfpManager.cpp',
                ]
                LOCAL_INCLUDES += [
                    'bluedroid/hfp',
                ]
            else:
                SOURCES += [
                    'bluedroid/hfp-fallback/BluetoothHfpManager.cpp',
                ]
                LOCAL_INCLUDES += [
                    'bluedroid/hfp-fallback',
                ]

            DEFINES['MOZ_B2G_BT_DAEMON'] = True
    elif CONFIG['MOZ_ENABLE_DBUS']:
        CFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
        CFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
        CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
        CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
        SOURCES += [
            'bluez/BluetoothDBusService.cpp',
            'bluez/BluetoothHfpManager.cpp',
        ]
        LOCAL_INCLUDES += [
            'bluez',
        ]
        DEFINES['MOZ_BLUETOOTH_DBUS'] = True
        DEFINES['HAVE_PTHREADS'] = True

    FINAL_LIBRARY = 'xul'

#
# Exported interfaces
#

EXPORTS.mozilla.dom.bluetooth.ipc += [
    'bluetooth2/ipc/BluetoothMessageUtils.h',
]
EXPORTS.mozilla.dom.bluetooth += [
    'bluetooth2/BluetoothAdapter.h',
    'bluetooth2/BluetoothClassOfDevice.h',
    'bluetooth2/BluetoothDevice.h',
    'bluetooth2/BluetoothDiscoveryHandle.h',
    'bluetooth2/BluetoothGatt.h',
    'bluetooth2/BluetoothGattCharacteristic.h',
    'bluetooth2/BluetoothGattDescriptor.h',
    'bluetooth2/BluetoothGattServer.h',
    'bluetooth2/BluetoothGattService.h',
    'bluetooth2/BluetoothLeDeviceEvent.h',
    'bluetooth2/BluetoothManager.h',
    'bluetooth2/BluetoothPairingHandle.h',
    'bluetooth2/BluetoothPairingListener.h',
    'BluetoothCommon.h',
    'BluetoothPbapRequestHandle.h',
]
IPDL_SOURCES += [
    'bluetooth2/ipc/BluetoothTypes.ipdlh',
    'bluetooth2/ipc/PBluetooth.ipdl',
    'bluetooth2/ipc/PBluetoothRequest.ipdl',
]

FAIL_ON_WARNINGS = True

LOCAL_INCLUDES += [
    '../base',
    '../network',
    '../system/gonk',
]

include('/ipc/chromium/chromium-config.mozbuild')