bluetooth: android: Strings included in Chrome build.
[chromium-blink-merge.git] / device / bluetooth / BUILD.gn
blob1c416c094125d6206ce9677f028e75d4e926c909
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 if (is_android) {
6   import("//build/config/android/rules.gni")  # For generate_jni().
9 config("bluetooth_config") {
10   if (is_win) {
11     ldflags = [
12       "/DELAYLOAD:BluetoothApis.dll",
14       # Despite MSDN stating that Bthprops.dll contains the
15       # symbols declared by bthprops.lib, they actually reside here:
16       "/DELAYLOAD:Bthprops.cpl",
17       "/DELAYLOAD:setupapi.dll",
18     ]
19   }
22 component("bluetooth") {
23   sources = [
24     "android/bluetooth_jni_registrar.cc",
25     "android/bluetooth_jni_registrar.h",
26     "android/wrappers.cc",
27     "android/wrappers.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_classic_device_mac.h",
53     "bluetooth_classic_device_mac.mm",
54     "bluetooth_device.cc",
55     "bluetooth_device.h",
56     "bluetooth_device_chromeos.cc",
57     "bluetooth_device_chromeos.h",
58     "bluetooth_device_mac.h",
59     "bluetooth_device_mac.mm",
60     "bluetooth_device_win.cc",
61     "bluetooth_device_win.h",
62     "bluetooth_discovery_filter.cc",
63     "bluetooth_discovery_filter.h",
64     "bluetooth_discovery_manager_mac.h",
65     "bluetooth_discovery_manager_mac.mm",
66     "bluetooth_discovery_session.cc",
67     "bluetooth_discovery_session.h",
68     "bluetooth_gatt_characteristic.cc",
69     "bluetooth_gatt_characteristic.h",
70     "bluetooth_gatt_connection.cc",
71     "bluetooth_gatt_connection.h",
72     "bluetooth_gatt_connection_chromeos.cc",
73     "bluetooth_gatt_connection_chromeos.h",
74     "bluetooth_gatt_descriptor.cc",
75     "bluetooth_gatt_descriptor.h",
76     "bluetooth_gatt_notify_session.cc",
77     "bluetooth_gatt_notify_session.h",
78     "bluetooth_gatt_notify_session_chromeos.cc",
79     "bluetooth_gatt_notify_session_chromeos.h",
80     "bluetooth_gatt_service.cc",
81     "bluetooth_gatt_service.h",
82     "bluetooth_init_win.cc",
83     "bluetooth_init_win.h",
84     "bluetooth_l2cap_channel_mac.h",
85     "bluetooth_l2cap_channel_mac.mm",
86     "bluetooth_low_energy_defs_win.cc",
87     "bluetooth_low_energy_defs_win.h",
88     "bluetooth_low_energy_device_mac.h",
89     "bluetooth_low_energy_device_mac.mm",
90     "bluetooth_low_energy_discovery_manager_mac.h",
91     "bluetooth_low_energy_discovery_manager_mac.mm",
92     "bluetooth_low_energy_win.cc",
93     "bluetooth_low_energy_win.h",
94     "bluetooth_pairing_chromeos.cc",
95     "bluetooth_pairing_chromeos.h",
96     "bluetooth_remote_gatt_characteristic_chromeos.cc",
97     "bluetooth_remote_gatt_characteristic_chromeos.h",
98     "bluetooth_remote_gatt_descriptor_chromeos.cc",
99     "bluetooth_remote_gatt_descriptor_chromeos.h",
100     "bluetooth_remote_gatt_service_chromeos.cc",
101     "bluetooth_remote_gatt_service_chromeos.h",
102     "bluetooth_rfcomm_channel_mac.h",
103     "bluetooth_rfcomm_channel_mac.mm",
104     "bluetooth_service_record_win.cc",
105     "bluetooth_service_record_win.h",
106     "bluetooth_socket.cc",
107     "bluetooth_socket.h",
108     "bluetooth_socket_chromeos.cc",
109     "bluetooth_socket_chromeos.h",
110     "bluetooth_socket_mac.h",
111     "bluetooth_socket_mac.mm",
112     "bluetooth_socket_net.cc",
113     "bluetooth_socket_net.h",
114     "bluetooth_socket_thread.cc",
115     "bluetooth_socket_thread.h",
116     "bluetooth_socket_win.cc",
117     "bluetooth_socket_win.h",
118     "bluetooth_task_manager_win.cc",
119     "bluetooth_task_manager_win.h",
120     "bluetooth_uuid.cc",
121     "bluetooth_uuid.h",
122   ]
124   defines = [ "DEVICE_BLUETOOTH_IMPLEMENTATION" ]
126   all_dependent_configs = [ ":bluetooth_config" ]
128   deps = [
129     "strings",
130     "uribeacon",
131     "//base",
132     "//net",
133     "//ui/base",
134   ]
136   if (is_android) {
137     deps += [ ":jni_headers" ]
138   }
140   if (is_chromeos) {
141     deps += [
142       "//chromeos",
143       "//dbus",
144     ]
145   }
147   if (is_mac) {
148     libs = [ "IOBluetooth.framework" ]
149   }
151   if (is_win) {
152     libs = [ "setupapi.lib" ]
153   }
156 static_library("mocks") {
157   testonly = true
158   sources = [
159     "test/mock_bluetooth_adapter.cc",
160     "test/mock_bluetooth_adapter.h",
161     "test/mock_bluetooth_advertisement.cc",
162     "test/mock_bluetooth_advertisement.h",
163     "test/mock_bluetooth_central_manager_mac.h",
164     "test/mock_bluetooth_central_manager_mac.mm",
165     "test/mock_bluetooth_device.cc",
166     "test/mock_bluetooth_device.h",
167     "test/mock_bluetooth_discovery_session.cc",
168     "test/mock_bluetooth_discovery_session.h",
169     "test/mock_bluetooth_gatt_characteristic.cc",
170     "test/mock_bluetooth_gatt_characteristic.h",
171     "test/mock_bluetooth_gatt_connection.cc",
172     "test/mock_bluetooth_gatt_connection.h",
173     "test/mock_bluetooth_gatt_descriptor.cc",
174     "test/mock_bluetooth_gatt_descriptor.h",
175     "test/mock_bluetooth_gatt_notify_session.cc",
176     "test/mock_bluetooth_gatt_notify_session.h",
177     "test/mock_bluetooth_gatt_service.cc",
178     "test/mock_bluetooth_gatt_service.h",
179     "test/mock_bluetooth_socket.cc",
180     "test/mock_bluetooth_socket.h",
181   ]
183   deps = [
184     ":bluetooth",
185     "//base",
186     "//net",
187     "//testing/gmock",
188   ]
191 if (is_android) {
192   java_sources_needing_jni = [
193     "android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java",
194     "android/java/src/org/chromium/device/bluetooth/Wrappers.java",
195   ]
197   generate_jni("jni_headers") {
198     sources = java_sources_needing_jni
199     jni_package = "bluetooth"
200   }
202   android_library("java") {
203     java_files = java_sources_needing_jni
204     deps = [
205       "//base:base_java",
206     ]
207   }