# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//build/config/features.gni") if (is_android) { import("//build/config/android/rules.gni") # For generate_jni(). } source_set("generic_sensor") { visibility = [ "//services/device:*" ] output_name = "generic_sensor" sources = [ "absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer.cc", "absolute_orientation_euler_angles_fusion_algorithm_using_accelerometer_and_magnetometer.h", "generic_sensor_consts.h", "linear_acceleration_fusion_algorithm_using_accelerometer.cc", "linear_acceleration_fusion_algorithm_using_accelerometer.h", "linux/sensor_data_linux.cc", "linux/sensor_data_linux.h", "orientation_euler_angles_fusion_algorithm_using_quaternion.cc", "orientation_euler_angles_fusion_algorithm_using_quaternion.h", "orientation_quaternion_fusion_algorithm_using_euler_angles.cc", "orientation_quaternion_fusion_algorithm_using_euler_angles.h", "orientation_util.cc", "orientation_util.h", "platform_sensor.cc", "platform_sensor.h", "platform_sensor_accelerometer_mac.cc", "platform_sensor_accelerometer_mac.h", "platform_sensor_ambient_light_mac.cc", "platform_sensor_ambient_light_mac.h", "platform_sensor_android.cc", "platform_sensor_android.h", "platform_sensor_fusion.cc", "platform_sensor_fusion.h", "platform_sensor_fusion_algorithm.cc", "platform_sensor_fusion_algorithm.h", "platform_sensor_linux.cc", "platform_sensor_linux.h", "platform_sensor_provider.cc", "platform_sensor_provider.h", "platform_sensor_provider_android.cc", "platform_sensor_provider_android.h", "platform_sensor_provider_base.cc", "platform_sensor_provider_base.h", "platform_sensor_provider_mac.cc", "platform_sensor_provider_mac.h", "platform_sensor_provider_win.cc", "platform_sensor_provider_win.h", "platform_sensor_reader_linux.cc", "platform_sensor_reader_linux.h", "platform_sensor_reader_win.cc", "platform_sensor_reader_win.h", "platform_sensor_win.cc", "platform_sensor_win.h", "relative_orientation_euler_angles_fusion_algorithm_using_accelerometer.cc", "relative_orientation_euler_angles_fusion_algorithm_using_accelerometer.h", "sensor_impl.cc", "sensor_impl.h", "sensor_provider_impl.cc", "sensor_provider_impl.h", ] deps = [ "//base", "//device/base/synchronization", "//services/device/public/cpp:device_features", "//ui/gfx/geometry:geometry", ] public_deps = [ "//services/device/public/cpp/generic_sensor", ] if (is_android) { deps += [ ":jni_headers" ] } if (is_mac) { deps += [ "//device/sensors/public/cpp:full", "//third_party/sudden_motion_sensor", ] libs = [ "CoreFoundation.framework", "IOKit.framework", ] } if (use_udev) { deps += [ "//device/base", "//device/udev_linux", ] sources += [ "linux/sensor_device_manager.cc", "linux/sensor_device_manager.h", "platform_sensor_provider_linux.cc", "platform_sensor_provider_linux.h", ] } if (is_win) { libs = [ "portabledeviceguids.lib", "sensorsapi.lib", ] } } if (is_android) { device_sensors_jni_sources = [ "android/java/src/org/chromium/device/sensors/PlatformSensor.java", "android/java/src/org/chromium/device/sensors/PlatformSensorProvider.java", ] generate_jni("jni_headers") { visibility = [ ":generic_sensor" ] sources = device_sensors_jni_sources jni_package = "device" } android_library("java") { visibility = [ "//services:*", "//services/device:*", ] java_files = device_sensors_jni_sources deps = [ "//base:base_java", "//services/device/public/interfaces:generic_sensor_java", ] } }