OLD | NEW |
| (Empty) |
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. | |
4 | |
5 import("//build/config/features.gni") | |
6 import("//mojo/public/tools/bindings/mojom.gni") | |
7 | |
8 # On android, BatteryManager mojo service is implemented directly in Java. | |
9 if (!is_android) { | |
10 component("battery") { | |
11 output_name = "device_battery" | |
12 | |
13 sources = [ | |
14 "battery_export.h", | |
15 "battery_monitor_impl.cc", | |
16 "battery_monitor_impl.h", | |
17 "battery_status_manager.h", | |
18 "battery_status_manager_chromeos.cc", | |
19 "battery_status_manager_default.cc", | |
20 "battery_status_manager_linux-inl.h", | |
21 "battery_status_manager_linux.cc", | |
22 "battery_status_manager_linux.h", | |
23 "battery_status_manager_mac.cc", | |
24 "battery_status_manager_win.cc", | |
25 "battery_status_manager_win.h", | |
26 "battery_status_service.cc", | |
27 "battery_status_service.h", | |
28 ] | |
29 | |
30 defines = [ "DEVICE_BATTERY_IMPLEMENTATION" ] | |
31 | |
32 deps = [ | |
33 ":mojo_bindings", | |
34 "//base", | |
35 "//base/third_party/dynamic_annotations", | |
36 "//mojo/public/cpp/bindings", | |
37 ] | |
38 | |
39 if (is_chromeos) { | |
40 configs += [ "//build/config/linux/dbus" ] | |
41 deps += [ | |
42 "//chromeos:chromeos", | |
43 "//chromeos:power_manager_proto", | |
44 ] | |
45 sources -= [ | |
46 "battery_status_manager_default.cc", | |
47 "battery_status_manager_linux.cc", | |
48 ] | |
49 } | |
50 | |
51 if (is_linux && !is_chromeos) { | |
52 if (use_dbus) { | |
53 configs += [ "//build/config/linux/dbus" ] | |
54 deps += [ "//dbus" ] | |
55 sources -= [ "battery_status_manager_default.cc" ] | |
56 } else { | |
57 sources -= [ "battery_status_manager_linux.cc" ] | |
58 } | |
59 } | |
60 | |
61 if (is_mac) { | |
62 sources -= [ "battery_status_manager_default.cc" ] | |
63 libs = [ | |
64 "CoreFoundation.framework", | |
65 "IOKit.framework", | |
66 ] | |
67 } | |
68 | |
69 if (is_win) { | |
70 sources -= [ "battery_status_manager_default.cc" ] | |
71 } | |
72 } | |
73 } | |
74 | |
75 mojom("mojo_bindings") { | |
76 sources = [ | |
77 "battery_monitor.mojom", | |
78 "battery_status.mojom", | |
79 ] | |
80 } | |
OLD | NEW |