Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / device / bluetooth / BUILD.gn
blobcb8f293596a417eed2a0b6b2d827a1b58aa6f6d2
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_android.cc",
57     "bluetooth_device_android.h",
58     "bluetooth_device_chromeos.cc",
59     "bluetooth_device_chromeos.h",
60     "bluetooth_device_mac.h",
61     "bluetooth_device_mac.mm",
62     "bluetooth_device_win.cc",
63     "bluetooth_device_win.h",
64     "bluetooth_discovery_filter.cc",
65     "bluetooth_discovery_filter.h",
66     "bluetooth_discovery_manager_mac.h",
67     "bluetooth_discovery_manager_mac.mm",
68     "bluetooth_discovery_session.cc",
69     "bluetooth_discovery_session.h",
70     "bluetooth_discovery_session_outcome.h",
71     "bluetooth_gatt_characteristic.cc",
72     "bluetooth_gatt_characteristic.h",
73     "bluetooth_gatt_connection.cc",
74     "bluetooth_gatt_connection.h",
75     "bluetooth_gatt_connection_chromeos.cc",
76     "bluetooth_gatt_connection_chromeos.h",
77     "bluetooth_gatt_descriptor.cc",
78     "bluetooth_gatt_descriptor.h",
79     "bluetooth_gatt_notify_session.cc",
80     "bluetooth_gatt_notify_session.h",
81     "bluetooth_gatt_notify_session_chromeos.cc",
82     "bluetooth_gatt_notify_session_chromeos.h",
83     "bluetooth_gatt_service.cc",
84     "bluetooth_gatt_service.h",
85     "bluetooth_init_win.cc",
86     "bluetooth_init_win.h",
87     "bluetooth_l2cap_channel_mac.h",
88     "bluetooth_l2cap_channel_mac.mm",
89     "bluetooth_low_energy_central_manager_delegate.h",
90     "bluetooth_low_energy_central_manager_delegate.mm",
91     "bluetooth_low_energy_defs_win.cc",
92     "bluetooth_low_energy_defs_win.h",
93     "bluetooth_low_energy_device_mac.h",
94     "bluetooth_low_energy_device_mac.mm",
95     "bluetooth_low_energy_discovery_manager_mac.h",
96     "bluetooth_low_energy_discovery_manager_mac.mm",
97     "bluetooth_low_energy_win.cc",
98     "bluetooth_low_energy_win.h",
99     "bluetooth_pairing_chromeos.cc",
100     "bluetooth_pairing_chromeos.h",
101     "bluetooth_remote_gatt_characteristic_chromeos.cc",
102     "bluetooth_remote_gatt_characteristic_chromeos.h",
103     "bluetooth_remote_gatt_descriptor_chromeos.cc",
104     "bluetooth_remote_gatt_descriptor_chromeos.h",
105     "bluetooth_remote_gatt_service_chromeos.cc",
106     "bluetooth_remote_gatt_service_chromeos.h",
107     "bluetooth_rfcomm_channel_mac.h",
108     "bluetooth_rfcomm_channel_mac.mm",
109     "bluetooth_service_record_win.cc",
110     "bluetooth_service_record_win.h",
111     "bluetooth_socket.cc",
112     "bluetooth_socket.h",
113     "bluetooth_socket_chromeos.cc",
114     "bluetooth_socket_chromeos.h",
115     "bluetooth_socket_mac.h",
116     "bluetooth_socket_mac.mm",
117     "bluetooth_socket_net.cc",
118     "bluetooth_socket_net.h",
119     "bluetooth_socket_thread.cc",
120     "bluetooth_socket_thread.h",
121     "bluetooth_socket_win.cc",
122     "bluetooth_socket_win.h",
123     "bluetooth_task_manager_win.cc",
124     "bluetooth_task_manager_win.h",
125     "bluetooth_uuid.cc",
126     "bluetooth_uuid.h",
127   ]
129   defines = [ "DEVICE_BLUETOOTH_IMPLEMENTATION" ]
131   all_dependent_configs = [ ":bluetooth_config" ]
133   deps = [
134     "strings",
135     "uribeacon",
136     "//base",
137     "//crypto",
138     "//net",
139     "//ui/base",
140   ]
142   if (is_android) {
143     deps += [ ":jni_headers" ]
144   }
146   if (is_chromeos) {
147     deps += [
148       "//chromeos",
149       "//dbus",
150     ]
151   }
153   if (is_mac) {
154     libs = [ "IOBluetooth.framework" ]
155   }
157   if (is_win) {
158     libs = [ "setupapi.lib" ]
159   }
162 static_library("mocks") {
163   testonly = true
164   sources = [
165     "test/mock_bluetooth_adapter.cc",
166     "test/mock_bluetooth_adapter.h",
167     "test/mock_bluetooth_advertisement.cc",
168     "test/mock_bluetooth_advertisement.h",
169     "test/mock_bluetooth_central_manager_mac.h",
170     "test/mock_bluetooth_central_manager_mac.mm",
171     "test/mock_bluetooth_device.cc",
172     "test/mock_bluetooth_device.h",
173     "test/mock_bluetooth_discovery_session.cc",
174     "test/mock_bluetooth_discovery_session.h",
175     "test/mock_bluetooth_gatt_characteristic.cc",
176     "test/mock_bluetooth_gatt_characteristic.h",
177     "test/mock_bluetooth_gatt_connection.cc",
178     "test/mock_bluetooth_gatt_connection.h",
179     "test/mock_bluetooth_gatt_descriptor.cc",
180     "test/mock_bluetooth_gatt_descriptor.h",
181     "test/mock_bluetooth_gatt_notify_session.cc",
182     "test/mock_bluetooth_gatt_notify_session.h",
183     "test/mock_bluetooth_gatt_service.cc",
184     "test/mock_bluetooth_gatt_service.h",
185     "test/mock_bluetooth_socket.cc",
186     "test/mock_bluetooth_socket.h",
187   ]
189   deps = [
190     ":bluetooth",
191     "//base",
192     "//net",
193     "//testing/gmock",
194   ]
197 if (is_android) {
198   java_sources_needing_jni = [
199     "android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java",
200     "android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java",
201     "android/java/src/org/chromium/device/bluetooth/Wrappers.java",
202   ]
204   generate_jni("jni_headers") {
205     sources = java_sources_needing_jni
206     jni_package = "bluetooth"
207   }
209   android_library("java") {
210     java_files = java_sources_needing_jni
211     deps = [
212       "//base:base_java",
213     ]
214   }