naiveproxy/device/gamepad/BUILD.gn

174 lines
4.7 KiB
Plaintext
Raw Permalink Normal View History

2018-12-10 05:59:24 +03:00
# 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/config.gni")
import("//build/config/android/rules.gni") # For generate_jni().
}
component("gamepad") {
output_name = "device_gamepad"
sources = [
"abstract_haptic_gamepad.cc",
"abstract_haptic_gamepad.h",
"dualshock4_controller_base.cc",
"dualshock4_controller_base.h",
"dualshock4_controller_linux.cc",
"dualshock4_controller_linux.h",
"dualshock4_controller_mac.cc",
"dualshock4_controller_mac.h",
"dualshock4_controller_win.cc",
"dualshock4_controller_win.h",
"game_controller_data_fetcher_mac.h",
"game_controller_data_fetcher_mac.mm",
"gamepad_consumer.cc",
"gamepad_consumer.h",
"gamepad_data_fetcher.cc",
"gamepad_data_fetcher.h",
"gamepad_data_fetcher_manager.cc",
"gamepad_data_fetcher_manager.h",
"gamepad_device_linux.cc",
"gamepad_device_linux.h",
"gamepad_device_mac.h",
"gamepad_device_mac.mm",
"gamepad_export.h",
"gamepad_haptics_manager.cc",
"gamepad_haptics_manager.h",
"gamepad_monitor.cc",
"gamepad_monitor.h",
"gamepad_pad_state_provider.cc",
"gamepad_pad_state_provider.h",
"gamepad_platform_data_fetcher.h",
"gamepad_platform_data_fetcher_android.cc",
"gamepad_platform_data_fetcher_android.h",
"gamepad_platform_data_fetcher_linux.cc",
"gamepad_platform_data_fetcher_linux.h",
"gamepad_platform_data_fetcher_mac.h",
"gamepad_platform_data_fetcher_mac.mm",
"gamepad_platform_data_fetcher_win.cc",
"gamepad_platform_data_fetcher_win.h",
"gamepad_provider.cc",
"gamepad_provider.h",
"gamepad_service.cc",
"gamepad_service.h",
"gamepad_shared_buffer.cc",
"gamepad_shared_buffer.h",
"gamepad_standard_mappings.cc",
"gamepad_standard_mappings.h",
"gamepad_standard_mappings_linux.cc",
"gamepad_standard_mappings_mac.mm",
"gamepad_standard_mappings_win.cc",
"gamepad_user_gesture.cc",
"gamepad_user_gesture.h",
"hid_dll_functions_win.cc",
"hid_dll_functions_win.h",
"raw_input_data_fetcher_win.cc",
"raw_input_data_fetcher_win.h",
"raw_input_gamepad_device_win.cc",
"raw_input_gamepad_device_win.h",
"switch_pro_controller_base.cc",
"switch_pro_controller_base.h",
"switch_pro_controller_linux.cc",
"switch_pro_controller_linux.h",
"udev_gamepad_linux.cc",
"udev_gamepad_linux.h",
"xbox_controller_mac.h",
"xbox_controller_mac.mm",
"xbox_data_fetcher_mac.cc",
"xbox_data_fetcher_mac.h",
"xinput_haptic_gamepad_win.cc",
"xinput_haptic_gamepad_win.h",
]
deps = [
"//base",
"//base/third_party/dynamic_annotations",
"//device/base/synchronization",
"//device/gamepad/public/cpp:shared_with_blink",
"//device/gamepad/public/cpp:switches",
"//device/gamepad/public/mojom",
"//mojo/public/cpp/system",
"//third_party/blink/public:blink_headers",
]
defines = [ "DEVICE_GAMEPAD_IMPLEMENTATION" ]
if (is_win) {
cflags = [ "/wd4267" ] # conversion from 'size_t' (64 bit) to 'type'(32 bit).
}
if (is_linux) {
if (use_udev) {
deps += [ "//device/udev_linux" ]
} else {
sources -= [
"gamepad_device_linux.cc",
"gamepad_platform_data_fetcher_linux.cc",
"udev_gamepad_linux.cc",
]
}
}
if (is_android) {
deps += [ ":jni_headers" ]
}
if (is_mac) {
libs = [
"CoreFoundation.framework",
"Foundation.framework",
"ForceFeedback.framework",
"GameController.framework",
"IOKit.framework",
]
}
}
static_library("test_helpers") {
testonly = true
sources = [
"gamepad_test_helpers.cc",
"gamepad_test_helpers.h",
]
public_deps = [
":gamepad",
"//base",
"//device/gamepad/public/cpp:shared_with_blink",
"//third_party/blink/public:blink_headers",
]
}
if (is_android) {
generate_jni("jni_headers") {
sources = [
"android/java/src/org/chromium/device/gamepad/GamepadList.java",
]
jni_package = "gamepad"
}
android_library("java") {
java_files = [
"android/java/src/org/chromium/device/gamepad/GamepadDevice.java",
"android/java/src/org/chromium/device/gamepad/GamepadList.java",
"android/java/src/org/chromium/device/gamepad/GamepadMappings.java",
]
deps = [
"//base:base_java",
"//third_party/android_tools:android_support_annotations_java",
]
srcjar_deps = [ ":java_enums_srcjar" ]
}
java_cpp_enum("java_enums_srcjar") {
sources = [
"gamepad_standard_mappings.h",
]
}
}