Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: device/battery/BUILD.gn

Issue 1674233002: gn: simplify dbus logic in device/battery (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refactor and simplify Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/features.gni") 5 import("//build/config/features.gni")
6 import("//mojo/public/tools/bindings/mojom.gni") 6 import("//mojo/public/tools/bindings/mojom.gni")
7 7
8 # On android, BatteryManager mojo service is implemented directly in Java. 8 # On android, BatteryManager mojo service is implemented directly in Java.
9 if (!is_android) { 9 if (!is_android) {
10 component("battery") { 10 component("battery") {
(...skipping 18 matching lines...) Expand all
29 29
30 deps = [ 30 deps = [
31 ":mojo_bindings", 31 ":mojo_bindings",
32 "//base", 32 "//base",
33 "//base/third_party/dynamic_annotations", 33 "//base/third_party/dynamic_annotations",
34 "//mojo/environment:chromium", 34 "//mojo/environment:chromium",
35 "//mojo/public/cpp/bindings", 35 "//mojo/public/cpp/bindings",
36 "//third_party/mojo/src/mojo/edk/system", 36 "//third_party/mojo/src/mojo/edk/system",
37 ] 37 ]
38 38
39 if (is_chromeos) { 39 if (is_linux) {
40 configs += [ "//build/config/linux:dbus" ] 40 remove_dbus_impl = false
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 41
51 if (is_desktop_linux) {
timvolodine 2016/02/09 13:59:04 maybe just use "if (is_linux && !is_chromeos) { ..
Mostyn Bramley-Moore 2016/02/09 21:38:51 How does patchset 5 look to you?
52 if (use_dbus) { 42 if (use_dbus) {
53 configs += [ "//build/config/linux:dbus" ]
54 deps += [ "//dbus" ] 43 deps += [ "//dbus" ]
55 sources -= [ "battery_status_manager_default.cc" ] 44 sources -= [ "battery_status_manager_default.cc" ]
56 } else { 45 } else {
46 remove_dbus_impl = true
47 }
48
49 if (is_chromeos) {
50 deps += [
51 "//chromeos:chromeos",
52 "//chromeos:power_manager_proto",
53 ]
54 remove_dbus_impl = true
55 }
56
57 if (remove_dbus_impl) {
57 sources -= [ "battery_status_manager_linux.cc" ] 58 sources -= [ "battery_status_manager_linux.cc" ]
58 } 59 }
59 } 60 }
60 61
61 if (is_mac) { 62 if (is_mac) {
62 sources -= [ "battery_status_manager_default.cc" ] 63 sources -= [ "battery_status_manager_default.cc" ]
63 } 64 }
64 65
65 if (is_win) { 66 if (is_win) {
66 sources -= [ "battery_status_manager_default.cc" ] 67 sources -= [ "battery_status_manager_default.cc" ]
67 } 68 }
68 } 69 }
69 } 70 }
70 71
71 mojom("mojo_bindings") { 72 mojom("mojo_bindings") {
72 sources = [ 73 sources = [
73 "battery_monitor.mojom", 74 "battery_monitor.mojom",
74 "battery_status.mojom", 75 "battery_status.mojom",
75 ] 76 ]
76 } 77 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698