[Mac] Parametize NativeAppWindowCocoaBrowserTest.
[chromium-blink-merge.git] / device / bluetooth / BUILD.gn
blob4f0dca30a6a05a645fdd9d3d93f770e6333fe621
1 # Copyright 2014 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.
5 import("//tools/grit/grit_rule.gni")
7 if (is_android) {
8   import("//build/config/android/rules.gni")  # For generate_jni().
11 config("bluetooth_config") {
12   if (is_win) {
13     ldflags = [
14       "/DELAYLOAD:BluetoothApis.dll",
16       # Despite MSDN stating that Bthprops.dll contains the
17       # symbols declared by bthprops.lib, they actually reside here:
18       "/DELAYLOAD:Bthprops.cpl",
19       "/DELAYLOAD:setupapi.dll",
20     ]
21   }
24 component("bluetooth") {
25   sources = [
26     "android/bluetooth_jni_registrar.cc",
27     "android/bluetooth_jni_registrar.h",
28     "bluetooth_adapter.cc",
29     "bluetooth_adapter.h",
30     "bluetooth_adapter_android.cc",
31     "bluetooth_adapter_android.h",
32     "bluetooth_adapter_chromeos.cc",
33     "bluetooth_adapter_chromeos.h",
34     "bluetooth_adapter_factory.cc",
35     "bluetooth_adapter_factory.h",
36     "bluetooth_adapter_mac.h",
37     "bluetooth_adapter_mac.mm",
38     "bluetooth_adapter_profile_chromeos.cc",
39     "bluetooth_adapter_profile_chromeos.h",
40     "bluetooth_adapter_win.cc",
41     "bluetooth_adapter_win.h",
42     "bluetooth_advertisement.cc",
43     "bluetooth_advertisement.h",
44     "bluetooth_advertisement_chromeos.cc",
45     "bluetooth_advertisement_chromeos.h",
46     "bluetooth_audio_sink.cc",
47     "bluetooth_audio_sink.h",
48     "bluetooth_audio_sink_chromeos.cc",
49     "bluetooth_audio_sink_chromeos.h",
50     "bluetooth_channel_mac.h",
51     "bluetooth_channel_mac.mm",
52     "bluetooth_device.cc",
53     "bluetooth_device.h",
54     "bluetooth_device_chromeos.cc",
55     "bluetooth_device_chromeos.h",
56     "bluetooth_device_mac.h",
57     "bluetooth_device_mac.mm",
58     "bluetooth_device_win.cc",
59     "bluetooth_device_win.h",
60     "bluetooth_discovery_filter.cc",
61     "bluetooth_discovery_filter.h",
62     "bluetooth_discovery_manager_mac.h",
63     "bluetooth_discovery_manager_mac.mm",
64     "bluetooth_discovery_session.cc",
65     "bluetooth_discovery_session.h",
66     "bluetooth_gatt_characteristic.cc",
67     "bluetooth_gatt_characteristic.h",
68     "bluetooth_gatt_connection.cc",
69     "bluetooth_gatt_connection.h",
70     "bluetooth_gatt_connection_chromeos.cc",
71     "bluetooth_gatt_connection_chromeos.h",
72     "bluetooth_gatt_descriptor.cc",
73     "bluetooth_gatt_descriptor.h",
74     "bluetooth_gatt_notify_session.cc",
75     "bluetooth_gatt_notify_session.h",
76     "bluetooth_gatt_notify_session_chromeos.cc",
77     "bluetooth_gatt_notify_session_chromeos.h",
78     "bluetooth_gatt_service.cc",
79     "bluetooth_gatt_service.h",
80     "bluetooth_init_win.cc",
81     "bluetooth_init_win.h",
82     "bluetooth_l2cap_channel_mac.h",
83     "bluetooth_l2cap_channel_mac.mm",
84     "bluetooth_low_energy_defs_win.cc",
85     "bluetooth_low_energy_defs_win.h",
86     "bluetooth_low_energy_device_mac.h",
87     "bluetooth_low_energy_device_mac.mm",
88     "bluetooth_low_energy_discovery_manager_mac.h",
89     "bluetooth_low_energy_discovery_manager_mac.mm",
90     "bluetooth_low_energy_win.cc",
91     "bluetooth_low_energy_win.h",
92     "bluetooth_pairing_chromeos.cc",
93     "bluetooth_pairing_chromeos.h",
94     "bluetooth_remote_gatt_characteristic_chromeos.cc",
95     "bluetooth_remote_gatt_characteristic_chromeos.h",
96     "bluetooth_remote_gatt_descriptor_chromeos.cc",
97     "bluetooth_remote_gatt_descriptor_chromeos.h",
98     "bluetooth_remote_gatt_service_chromeos.cc",
99     "bluetooth_remote_gatt_service_chromeos.h",
100     "bluetooth_rfcomm_channel_mac.h",
101     "bluetooth_rfcomm_channel_mac.mm",
102     "bluetooth_service_record_win.cc",
103     "bluetooth_service_record_win.h",
104     "bluetooth_socket.cc",
105     "bluetooth_socket.h",
106     "bluetooth_socket_chromeos.cc",
107     "bluetooth_socket_chromeos.h",
108     "bluetooth_socket_mac.h",
109     "bluetooth_socket_mac.mm",
110     "bluetooth_socket_net.cc",
111     "bluetooth_socket_net.h",
112     "bluetooth_socket_thread.cc",
113     "bluetooth_socket_thread.h",
114     "bluetooth_socket_win.cc",
115     "bluetooth_socket_win.h",
116     "bluetooth_task_manager_win.cc",
117     "bluetooth_task_manager_win.h",
118     "bluetooth_uuid.cc",
119     "bluetooth_uuid.h",
120   ]
122   defines = [ "DEVICE_BLUETOOTH_IMPLEMENTATION" ]
124   all_dependent_configs = [ ":bluetooth_config" ]
126   deps = [
127     ":strings",
128     "uribeacon",
129     "//base",
130     "//net",
131     "//ui/base",
132   ]
134   if (is_android) {
135     deps += [ ":bluetooth_jni" ]
136   }
138   if (is_chromeos) {
139     deps += [
140       "//chromeos",
141       "//dbus",
142     ]
143   }
145   if (is_mac) {
146     libs = [ "IOBluetooth.framework" ]
147   }
149   if (is_win) {
150     libs = [ "setupapi.lib" ]
151   }
154 grit("strings") {
155   source = "bluetooth_strings.grd"
156   outputs = [
157     "grit/device_bluetooth_strings.h",
158     "device_bluetooth_strings_am.pak",
159     "device_bluetooth_strings_ar.pak",
160     "device_bluetooth_strings_bg.pak",
161     "device_bluetooth_strings_bn.pak",
162     "device_bluetooth_strings_ca.pak",
163     "device_bluetooth_strings_cs.pak",
164     "device_bluetooth_strings_da.pak",
165     "device_bluetooth_strings_de.pak",
166     "device_bluetooth_strings_el.pak",
167     "device_bluetooth_strings_en-GB.pak",
168     "device_bluetooth_strings_en-US.pak",
169     "device_bluetooth_strings_es.pak",
170     "device_bluetooth_strings_es-419.pak",
171     "device_bluetooth_strings_et.pak",
172     "device_bluetooth_strings_fa.pak",
173     "device_bluetooth_strings_fake-bidi.pak",
174     "device_bluetooth_strings_fi.pak",
175     "device_bluetooth_strings_fil.pak",
176     "device_bluetooth_strings_fr.pak",
177     "device_bluetooth_strings_gu.pak",
178     "device_bluetooth_strings_he.pak",
179     "device_bluetooth_strings_hi.pak",
180     "device_bluetooth_strings_hr.pak",
181     "device_bluetooth_strings_hu.pak",
182     "device_bluetooth_strings_id.pak",
183     "device_bluetooth_strings_it.pak",
184     "device_bluetooth_strings_ja.pak",
185     "device_bluetooth_strings_kn.pak",
186     "device_bluetooth_strings_ko.pak",
187     "device_bluetooth_strings_lt.pak",
188     "device_bluetooth_strings_lv.pak",
189     "device_bluetooth_strings_ml.pak",
190     "device_bluetooth_strings_mr.pak",
191     "device_bluetooth_strings_ms.pak",
192     "device_bluetooth_strings_nl.pak",
193     "device_bluetooth_strings_nb.pak",
194     "device_bluetooth_strings_pl.pak",
195     "device_bluetooth_strings_pt-BR.pak",
196     "device_bluetooth_strings_pt-PT.pak",
197     "device_bluetooth_strings_ro.pak",
198     "device_bluetooth_strings_ru.pak",
199     "device_bluetooth_strings_sk.pak",
200     "device_bluetooth_strings_sl.pak",
201     "device_bluetooth_strings_sr.pak",
202     "device_bluetooth_strings_sv.pak",
203     "device_bluetooth_strings_sw.pak",
204     "device_bluetooth_strings_ta.pak",
205     "device_bluetooth_strings_te.pak",
206     "device_bluetooth_strings_th.pak",
207     "device_bluetooth_strings_tr.pak",
208     "device_bluetooth_strings_uk.pak",
209     "device_bluetooth_strings_vi.pak",
210     "device_bluetooth_strings_zh-CN.pak",
211     "device_bluetooth_strings_zh-TW.pak",
212   ]
215 static_library("mocks") {
216   testonly = true
217   sources = [
218     "test/mock_bluetooth_adapter.cc",
219     "test/mock_bluetooth_adapter.h",
220     "test/mock_bluetooth_advertisement.cc",
221     "test/mock_bluetooth_advertisement.h",
222     "test/mock_bluetooth_device.cc",
223     "test/mock_bluetooth_device.h",
224     "test/mock_bluetooth_discovery_session.cc",
225     "test/mock_bluetooth_discovery_session.h",
226     "test/mock_bluetooth_gatt_characteristic.cc",
227     "test/mock_bluetooth_gatt_characteristic.h",
228     "test/mock_bluetooth_gatt_connection.cc",
229     "test/mock_bluetooth_gatt_connection.h",
230     "test/mock_bluetooth_gatt_descriptor.cc",
231     "test/mock_bluetooth_gatt_descriptor.h",
232     "test/mock_bluetooth_gatt_notify_session.cc",
233     "test/mock_bluetooth_gatt_notify_session.h",
234     "test/mock_bluetooth_gatt_service.cc",
235     "test/mock_bluetooth_gatt_service.h",
236     "test/mock_bluetooth_socket.cc",
237     "test/mock_bluetooth_socket.h",
238   ]
240   deps = [
241     ":bluetooth",
242     "//base",
243     "//net",
244     "//testing/gmock",
245   ]
248 if (is_android) {
249   generate_jni("bluetooth_jni") {
250     sources = [
251       "android/java/src/org/chromium/device/bluetooth/BluetoothAdapter.java",
252     ]
253     jni_package = "bluetooth"
254   }