diff options
author | leon.han <leon.han@intel.com> | 2015-09-02 00:12:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-02 07:12:31 +0000 |
commit | 4e5d810cb0cfeccb530119d80b07d34c098eafc2 (patch) | |
tree | 0368c4c8749418eb310e1daac69d5ecb2b47fa2f /device/battery | |
parent | 81ef4ddf8497da864d4b6af0268f02bba04b4ca7 (diff) | |
download | chromium_src-4e5d810cb0cfeccb530119d80b07d34c098eafc2.zip chromium_src-4e5d810cb0cfeccb530119d80b07d34c098eafc2.tar.gz chromium_src-4e5d810cb0cfeccb530119d80b07d34c098eafc2.tar.bz2 |
Exclude BatteryMonitor C++ impl files from Android build.
As BatteryMonitor mojo interface is implemented with Java
directly on Android, should exclude its C++ implementation.
Further, exclude BatteryStatusService and PowerUsageMonitor
as well, which are not needed for Android build.
BUG=
Review URL: https://codereview.chromium.org/1286853003
Cr-Commit-Position: refs/heads/master@{#346860}
Diffstat (limited to 'device/battery')
-rw-r--r-- | device/battery/BUILD.gn | 99 | ||||
-rw-r--r-- | device/battery/DEPS | 1 | ||||
-rw-r--r-- | device/battery/battery.gyp | 143 |
3 files changed, 122 insertions, 121 deletions
diff --git a/device/battery/BUILD.gn b/device/battery/BUILD.gn index 778ee81..6eab813 100644 --- a/device/battery/BUILD.gn +++ b/device/battery/BUILD.gn @@ -5,63 +5,66 @@ import("//build/config/features.gni") import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni") -component("battery") { - output_name = "device_battery" +# On android, BatteryManager mojo service is implemented directly in Java. +if (!is_android) { + component("battery") { + output_name = "device_battery" - sources = [ - "battery_export.h", - "battery_monitor_impl.cc", - "battery_monitor_impl.h", - "battery_status_manager_chromeos.cc", - "battery_status_manager_default.cc", - "battery_status_manager_linux.cc", - "battery_status_manager_linux.h", - "battery_status_manager_mac.cc", - "battery_status_manager_win.cc", - "battery_status_manager_win.h", - "battery_status_service.cc", - "battery_status_service.h", - ] - - defines = [ "DEVICE_BATTERY_IMPLEMENTATION" ] - - deps = [ - ":mojo_bindings", - "//base", - "//base/third_party/dynamic_annotations", - "//mojo/environment:chromium", - "//third_party/mojo/src/mojo/public/cpp/bindings", - "//third_party/mojo/src/mojo/edk/system", - ] - - if (is_chromeos) { - configs += [ "//build/config/linux:dbus" ] - deps += [ - "//chromeos:chromeos", - "//chromeos:power_manager_proto", - ] - sources -= [ + sources = [ + "battery_export.h", + "battery_monitor_impl.cc", + "battery_monitor_impl.h", + "battery_status_manager_chromeos.cc", "battery_status_manager_default.cc", "battery_status_manager_linux.cc", + "battery_status_manager_linux.h", + "battery_status_manager_mac.cc", + "battery_status_manager_win.cc", + "battery_status_manager_win.h", + "battery_status_service.cc", + "battery_status_service.h", + ] + + defines = [ "DEVICE_BATTERY_IMPLEMENTATION" ] + + deps = [ + ":mojo_bindings", + "//base", + "//base/third_party/dynamic_annotations", + "//mojo/environment:chromium", + "//third_party/mojo/src/mojo/public/cpp/bindings", + "//third_party/mojo/src/mojo/edk/system", ] - } - if (is_desktop_linux) { - if (use_dbus) { + if (is_chromeos) { configs += [ "//build/config/linux:dbus" ] - deps += [ "//dbus" ] - sources -= [ "battery_status_manager_default.cc" ] - } else { - sources -= [ "battery_status_manager_linux.cc" ] + deps += [ + "//chromeos:chromeos", + "//chromeos:power_manager_proto", + ] + sources -= [ + "battery_status_manager_default.cc", + "battery_status_manager_linux.cc", + ] } - } - if (is_mac) { - sources -= [ "battery_status_manager_default.cc" ] - } + if (is_desktop_linux) { + if (use_dbus) { + configs += [ "//build/config/linux:dbus" ] + deps += [ "//dbus" ] + sources -= [ "battery_status_manager_default.cc" ] + } else { + sources -= [ "battery_status_manager_linux.cc" ] + } + } - if (is_win) { - sources -= [ "battery_status_manager_default.cc" ] + if (is_mac) { + sources -= [ "battery_status_manager_default.cc" ] + } + + if (is_win) { + sources -= [ "battery_status_manager_default.cc" ] + } } } diff --git a/device/battery/DEPS b/device/battery/DEPS index 17e295b..d6abdda 100644 --- a/device/battery/DEPS +++ b/device/battery/DEPS @@ -1,4 +1,3 @@ include_rules = [ "+dbus", - "+jni" ] diff --git a/device/battery/battery.gyp b/device/battery/battery.gyp index d55c7f9..679630f 100644 --- a/device/battery/battery.gyp +++ b/device/battery/battery.gyp @@ -8,7 +8,7 @@ }, 'targets': [ { - # GN version: //device/battery:battery_mojo + # GN version: //device/battery:mojo_bindings 'target_name': 'device_battery_mojo_bindings', 'type': 'static_library', 'includes': [ @@ -48,77 +48,6 @@ ], 'hard_dependency': 1, }, - { - # GN version: //device/battery - 'target_name': 'device_battery', - 'type': '<(component)', - 'dependencies': [ - '../../base/base.gyp:base', - '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', - '../../mojo/mojo_base.gyp:mojo_environment_chromium', - '../../third_party/mojo/mojo_edk.gyp:mojo_system_impl', - '../../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings', - 'device_battery_mojo_bindings', - ], - 'defines': [ - 'DEVICE_BATTERY_IMPLEMENTATION', - ], - 'sources': [ - 'battery_monitor_impl.cc', - 'battery_monitor_impl.h', - 'battery_status_manager_chromeos.cc', - 'battery_status_manager_default.cc', - 'battery_status_manager_linux.cc', - 'battery_status_manager_linux.h', - 'battery_status_manager_mac.cc', - 'battery_status_manager_win.cc', - 'battery_status_manager_win.h', - 'battery_status_manager.h', - 'battery_status_service.cc', - 'battery_status_service.h', - ], - 'conditions': [ - ['chromeos==1', { - 'dependencies': [ - '../../build/linux/system.gyp:dbus', - '../../chromeos/chromeos.gyp:chromeos', - '../../chromeos/chromeos.gyp:power_manager_proto', - ], - 'sources!': [ - 'battery_status_manager_default.cc', - 'battery_status_manager_linux.cc', - ], - }], - ['OS == "android"', { - 'dependencies': [ - 'device_battery_java', - ], - }], - ['OS == "linux" and use_dbus==1', { - 'sources!': [ - 'battery_status_manager_default.cc', - ], - 'dependencies': [ - '../../build/linux/system.gyp:dbus', - '../../dbus/dbus.gyp:dbus', - ], - }, { # OS != "linux" or use_dbus==0 - 'sources!': [ - 'battery_status_manager_linux.cc', - ], - }], - ['OS == "mac"', { - 'sources!': [ - 'battery_status_manager_default.cc', - ], - }], - ['OS == "win"', { - 'sources!': [ - 'battery_status_manager_default.cc', - ], - }], - ], - }, ], 'conditions': [ ['OS == "android"', { @@ -150,6 +79,76 @@ 'includes': [ '../../build/java.gypi' ], }, ], + }, { # OS != "android" + # On android, BatteryManager mojo service is implemented directly in Java. + 'targets': [ + { + # GN version: //device/battery + 'target_name': 'device_battery', + 'type': '<(component)', + 'dependencies': [ + '../../base/base.gyp:base', + '../../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', + '../../mojo/mojo_base.gyp:mojo_environment_chromium', + '../../third_party/mojo/mojo_edk.gyp:mojo_system_impl', + '../../third_party/mojo/mojo_public.gyp:mojo_cpp_bindings', + 'device_battery_mojo_bindings', + ], + 'defines': [ + 'DEVICE_BATTERY_IMPLEMENTATION', + ], + 'sources': [ + 'battery_monitor_impl.cc', + 'battery_monitor_impl.h', + 'battery_status_manager_chromeos.cc', + 'battery_status_manager_default.cc', + 'battery_status_manager_linux.cc', + 'battery_status_manager_linux.h', + 'battery_status_manager_mac.cc', + 'battery_status_manager_win.cc', + 'battery_status_manager_win.h', + 'battery_status_manager.h', + 'battery_status_service.cc', + 'battery_status_service.h', + ], + 'conditions': [ + ['chromeos==1', { + 'dependencies': [ + '../../build/linux/system.gyp:dbus', + '../../chromeos/chromeos.gyp:chromeos', + '../../chromeos/chromeos.gyp:power_manager_proto', + ], + 'sources!': [ + 'battery_status_manager_default.cc', + 'battery_status_manager_linux.cc', + ], + }], + ['OS == "linux" and use_dbus==1', { + 'sources!': [ + 'battery_status_manager_default.cc', + ], + 'dependencies': [ + '../../build/linux/system.gyp:dbus', + '../../dbus/dbus.gyp:dbus', + ], + }, { # OS != "linux" or use_dbus==0 + 'sources!': [ + 'battery_status_manager_linux.cc', + ], + }], + ['OS == "mac"', { + 'sources!': [ + 'battery_status_manager_default.cc', + ], + }], + ['OS == "win"', { + 'sources!': [ + 'battery_status_manager_default.cc', + ], + }], + ], + }, + ], }], ], } |