Roll src/third_party/WebKit 787a07c:716df21 (svn 201034:201036)
[chromium-blink-merge.git] / device / bluetooth / bluetooth.gyp
blob945e18033cb3a8708e1469b227cbdb7252f4f7d2
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   'variables': {
7     'chromium_code': 1,
8   },
9   'targets': [
10     {
11       # GN version: //device/bluetooth
12       'target_name': 'device_bluetooth',
13       'type': '<(component)',
14       'dependencies': [
15         '../../base/base.gyp:base',
16         '../../crypto/crypto.gyp:crypto',
17         '../../net/net.gyp:net',
18         '../../ui/base/ui_base.gyp:ui_base',
19         'bluetooth_strings.gyp:bluetooth_strings',
20         'uribeacon',
21       ],
22       'defines': [
23         'DEVICE_BLUETOOTH_IMPLEMENTATION',
24       ],
25       'sources': [
26         # Note: file list duplicated in GN build.
27         'android/bluetooth_jni_registrar.cc',
28         'android/bluetooth_jni_registrar.h',
29         'android/wrappers.cc',
30         'android/wrappers.h',
31         'bluetooth_adapter.cc',
32         'bluetooth_adapter.h',
33         'bluetooth_adapter_android.cc',
34         'bluetooth_adapter_android.h',
35         'bluetooth_adapter_chromeos.cc',
36         'bluetooth_adapter_chromeos.h',
37         'bluetooth_adapter_factory.cc',
38         'bluetooth_adapter_factory.h',
39         'bluetooth_adapter_mac.h',
40         'bluetooth_adapter_mac.mm',
41         "bluetooth_adapter_profile_chromeos.cc",
42         "bluetooth_adapter_profile_chromeos.h",
43         'bluetooth_adapter_win.cc',
44         'bluetooth_adapter_win.h',
45         'bluetooth_advertisement.cc',
46         'bluetooth_advertisement.h',
47         'bluetooth_advertisement_chromeos.cc',
48         'bluetooth_advertisement_chromeos.h',
49         'bluetooth_audio_sink.cc',
50         'bluetooth_audio_sink.h',
51         'bluetooth_audio_sink_chromeos.cc',
52         'bluetooth_audio_sink_chromeos.h',
53         'bluetooth_channel_mac.mm',
54         'bluetooth_channel_mac.h',
55         'bluetooth_classic_device_mac.mm',
56         'bluetooth_classic_device_mac.h',
57         'bluetooth_device.cc',
58         'bluetooth_device.h',
59         'bluetooth_device_android.h',
60         'bluetooth_device_android.cc',
61         'bluetooth_device_chromeos.cc',
62         'bluetooth_device_chromeos.h',
63         'bluetooth_device_mac.mm',
64         'bluetooth_device_mac.h',
65         'bluetooth_device_win.cc',
66         'bluetooth_device_win.h',
67         'bluetooth_discovery_filter.cc',
68         'bluetooth_discovery_filter.h',
69         'bluetooth_discovery_manager_mac.mm',
70         'bluetooth_discovery_manager_mac.h',
71         'bluetooth_discovery_session.cc',
72         'bluetooth_discovery_session.h',
73         'bluetooth_gatt_characteristic.cc',
74         'bluetooth_gatt_characteristic.h',
75         'bluetooth_gatt_connection.cc',
76         'bluetooth_gatt_connection.h',
77         'bluetooth_gatt_connection_chromeos.cc',
78         'bluetooth_gatt_connection_chromeos.h',
79         'bluetooth_gatt_descriptor.cc',
80         'bluetooth_gatt_descriptor.h',
81         'bluetooth_gatt_notify_session.cc',
82         'bluetooth_gatt_notify_session.h',
83         'bluetooth_gatt_notify_session_chromeos.cc',
84         'bluetooth_gatt_notify_session_chromeos.h',
85         'bluetooth_gatt_service.cc',
86         'bluetooth_gatt_service.h',
87         'bluetooth_init_win.cc',
88         'bluetooth_init_win.h',
89         'bluetooth_l2cap_channel_mac.mm',
90         'bluetooth_l2cap_channel_mac.h',
91         'bluetooth_low_energy_central_manager_delegate.mm',
92         'bluetooth_low_energy_central_manager_delegate.h',
93         'bluetooth_low_energy_defs_win.cc',
94         'bluetooth_low_energy_defs_win.h',
95         'bluetooth_low_energy_device_mac.h',
96         'bluetooth_low_energy_device_mac.mm',
97         'bluetooth_low_energy_discovery_manager_mac.h',
98         'bluetooth_low_energy_discovery_manager_mac.mm',
99         'bluetooth_low_energy_win.cc',
100         'bluetooth_low_energy_win.h',
101         'bluetooth_pairing_chromeos.cc',
102         'bluetooth_pairing_chromeos.h',
103         'bluetooth_remote_gatt_characteristic_chromeos.cc',
104         'bluetooth_remote_gatt_characteristic_chromeos.h',
105         'bluetooth_remote_gatt_descriptor_chromeos.cc',
106         'bluetooth_remote_gatt_descriptor_chromeos.h',
107         'bluetooth_remote_gatt_service_chromeos.cc',
108         'bluetooth_remote_gatt_service_chromeos.h',
109         'bluetooth_rfcomm_channel_mac.mm',
110         'bluetooth_rfcomm_channel_mac.h',
111         'bluetooth_service_record_win.cc',
112         'bluetooth_service_record_win.h',
113         'bluetooth_socket.cc',
114         'bluetooth_socket.h',
115         'bluetooth_socket_chromeos.cc',
116         'bluetooth_socket_chromeos.h',
117         'bluetooth_socket_mac.h',
118         'bluetooth_socket_mac.mm',
119         'bluetooth_socket_net.cc',
120         'bluetooth_socket_net.h',
121         'bluetooth_socket_thread.cc',
122         'bluetooth_socket_thread.h',
123         'bluetooth_socket_win.cc',
124         'bluetooth_socket_win.h',
125         'bluetooth_task_manager_win.cc',
126         'bluetooth_task_manager_win.h',
127         'bluetooth_uuid.cc',
128         'bluetooth_uuid.h',
129       ],
130       'conditions': [
131         ['chromeos==1', {
132           'dependencies': [
133             '../../build/linux/system.gyp:dbus',
134             '../../chromeos/chromeos.gyp:chromeos',
135             '../../dbus/dbus.gyp:dbus',
136           ],
137           'export_dependent_settings': [
138             '../../build/linux/system.gyp:dbus'
139           ]
140         }],
141         ['OS == "android"', {
142           'dependencies': [
143             'device_bluetooth_java',
144             'device_bluetooth_jni_headers',
145           ],
146         }],
147         ['OS=="win"', {
148           # The following two blocks are duplicated. They apply to static lib
149           # and shared lib configurations respectively.
150           'all_dependent_settings': {  # For static lib, apply to dependents.
151             'msvs_settings': {
152               'VCLinkerTool': {
153                 'DelayLoadDLLs': [
154                   'BluetoothApis.dll',
155                   # Despite MSDN stating that Bthprops.dll contains the
156                   # symbols declared by bthprops.lib, they actually reside here:
157                   'Bthprops.cpl',
158                   'setupapi.dll',
159                 ],
160               },
161             },
162           },
163           'msvs_settings': {  # For shared lib, apply to self.
164             'VCLinkerTool': {
165               'DelayLoadDLLs': [
166                 'BluetoothApis.dll',
167                 # Despite MSDN stating that Bthprops.dll contains the
168                 # symbols declared by bthprops.lib, they actually reside here:
169                 'Bthprops.cpl',
170                 'setupapi.dll',
171               ],
172             },
173           },
174         }],
175         ['OS=="mac"', {
176           'link_settings': {
177             'libraries': [
178               '$(SDKROOT)/System/Library/Frameworks/IOBluetooth.framework',
179             ],
180             'conditions': [
181               ['mac_sdk == "10.10"', {
182                 'xcode_settings': {
183                   # In the OSX 10.10 SDK, CoreBluetooth became a top level
184                   # framework. Previously, it was nested in IOBluetooth. In
185                   # order for Chrome to run on OSes older than OSX 10.10, the
186                   # top level CoreBluetooth framework must be weakly linked.
187                   'OTHER_LDFLAGS': [
188                     '-weak_framework CoreBluetooth',
189                   ],
190                 },
191               }],
192             ],
193           },
194         }],
195       ],
196     },
197     {
198       # GN version: //device/bluetooth/uribeacon
199       'target_name': 'uribeacon',
200       'type': 'static_library',
201       'dependencies': [
202         '../../base/base.gyp:base',
203       ],
204       'sources': [
205         'uribeacon/uri_encoder.cc',
206         'uribeacon/uri_encoder.h'
207       ]
208     },
209     {
210       # GN version: //device/bluetooth:mocks
211       'target_name': 'device_bluetooth_mocks',
212       'type': 'static_library',
213       'dependencies': [
214         '../../testing/gmock.gyp:gmock',
215         'device_bluetooth',
216       ],
217       'include_dirs': [
218         '../../',
219       ],
220       'sources': [
221         # Note: file list duplicated in GN build.
222         'test/mock_bluetooth_adapter.cc',
223         'test/mock_bluetooth_adapter.h',
224         'test/mock_bluetooth_advertisement.cc',
225         'test/mock_bluetooth_advertisement.h',
226         'test/mock_bluetooth_central_manager_mac.mm',
227         'test/mock_bluetooth_central_manager_mac.h',
228         'test/mock_bluetooth_device.cc',
229         'test/mock_bluetooth_device.h',
230         'test/mock_bluetooth_discovery_session.cc',
231         'test/mock_bluetooth_discovery_session.h',
232         'test/mock_bluetooth_gatt_characteristic.cc',
233         'test/mock_bluetooth_gatt_characteristic.h',
234         'test/mock_bluetooth_gatt_connection.cc',
235         'test/mock_bluetooth_gatt_connection.h',
236         'test/mock_bluetooth_gatt_descriptor.cc',
237         'test/mock_bluetooth_gatt_descriptor.h',
238         'test/mock_bluetooth_gatt_notify_session.cc',
239         'test/mock_bluetooth_gatt_notify_session.h',
240         'test/mock_bluetooth_gatt_service.cc',
241         'test/mock_bluetooth_gatt_service.h',
242         'test/mock_bluetooth_socket.cc',
243         'test/mock_bluetooth_socket.h',
244       ],
245     },
246   ],
247   'conditions': [
248     ['OS == "android"', {
249       'targets': [
250         {
251           'target_name': 'device_bluetooth_jni_headers',
252           'type': 'none',
253           'sources': [
254             'android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java',
255             'android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java',
256             'android/java/src/org/chromium/device/bluetooth/Wrappers.java',
257           ],
258           'variables': {
259             'jni_gen_package': 'device_bluetooth',
260           },
261           'includes': [ '../../build/jni_generator.gypi' ],
262         },
263         {
264           'target_name': 'device_bluetooth_java',
265           'type': 'none',
266           'dependencies': [
267             '../../base/base.gyp:base',
268           ],
269           'variables': {
270             'java_in_dir': '../../device/bluetooth/android/java',
271           },
272           'includes': [ '../../build/java.gypi' ],
273         },
274       ],
275     }],
276   ],