Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2016 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 | |
| 7 if (is_android) { | |
| 8 import("//build/config/android/config.gni") | |
| 9 import("//build/config/android/rules.gni") # For generate_jni(). | |
| 10 } | |
| 11 | |
| 12 component("gamepad") { | |
| 13 output_name = "device_gamepad" | |
| 14 | |
| 15 sources = [ | |
| 16 "gamepad_consumer.h", | |
| 17 "gamepad_data_fetcher.cc", | |
| 18 "gamepad_data_fetcher.h", | |
| 19 "gamepad_platform_data_fetcher.h", | |
| 20 "gamepad_platform_data_fetcher_android.cc", | |
| 21 "gamepad_platform_data_fetcher_android.h", | |
| 22 "gamepad_platform_data_fetcher_linux.cc", | |
| 23 "gamepad_platform_data_fetcher_linux.h", | |
| 24 "gamepad_platform_data_fetcher_mac.h", | |
| 25 "gamepad_platform_data_fetcher_mac.mm", | |
| 26 "gamepad_platform_data_fetcher_win.cc", | |
| 27 "gamepad_platform_data_fetcher_win.h", | |
| 28 "gamepad_provider.cc", | |
| 29 "gamepad_provider.h", | |
| 30 "gamepad_standard_mappings.cc", | |
| 31 "gamepad_standard_mappings.h", | |
| 32 "gamepad_standard_mappings_linux.cc", | |
| 33 "gamepad_standard_mappings_mac.mm", | |
| 34 "gamepad_standard_mappings_win.cc", | |
| 35 "gamepad_user_gesture.cc", | |
| 36 "gamepad_user_gesture.h", | |
| 37 "raw_input_data_fetcher_win.cc", | |
| 38 "raw_input_data_fetcher_win.h", | |
| 39 "xbox_data_fetcher_mac.cc", | |
| 40 "xbox_data_fetcher_mac.h", | |
| 41 ] | |
| 42 | |
| 43 deps = [ | |
| 44 "//base", | |
| 45 "//base/third_party/dynamic_annotations", | |
| 46 "//third_party/WebKit/public:blink_headers", | |
| 47 ] | |
| 48 | |
| 49 defines = [ "DEVICE_GAMEPAD_IMPLEMENTATION" ] | |
| 50 | |
| 51 if (is_win) { | |
| 52 cflags = [ "/wd4267" ] # conversion from 'size_t' (64 bit) to 'type'(32 bit ). | |
| 53 } | |
| 54 | |
| 55 if (is_linux && use_udev) { | |
| 56 deps += [ "//device/udev_linux" ] | |
| 57 } else if (!is_win && !is_mac && !is_android) { | |
| 58 sources += [ "gamepad_platform_data_fetcher.cc" ] | |
| 59 sources -= [ "gamepad_platform_data_fetcher_linux.cc" ] | |
| 60 } | |
| 61 | |
| 62 if (is_android) { | |
| 63 deps += [ ":jni_headers" ] | |
| 64 } | |
| 65 } | |
|
Robert Sesek
2016/07/01 17:40:17
To fix the Mac errors, you need:
if (is_mac) {
| |
| 66 | |
| 67 static_library("test_helpers") { | |
| 68 testonly = true | |
| 69 | |
| 70 sources = [ | |
| 71 "gamepad_test_helpers.cc", | |
| 72 "gamepad_test_helpers.h", | |
| 73 ] | |
| 74 | |
| 75 public_deps = [ | |
| 76 ":gamepad", | |
| 77 "//base", | |
| 78 "//third_party/WebKit/public:blink_headers", | |
| 79 ] | |
| 80 } | |
| 81 | |
| 82 if (is_android) { | |
| 83 generate_jni("jni_headers") { | |
| 84 sources = [ | |
| 85 "android/java/src/org/chromium/device/gamepad/GamepadList.java", | |
| 86 ] | |
| 87 jni_package = "gamepad" | |
| 88 } | |
| 89 | |
| 90 android_library("java") { | |
| 91 java_files = [ | |
| 92 "android/java/src/org/chromium/device/gamepad/GamepadDevice.java", | |
| 93 "android/java/src/org/chromium/device/gamepad/GamepadList.java", | |
| 94 "android/java/src/org/chromium/device/gamepad/GamepadMappings.java", | |
| 95 ] | |
| 96 deps = [ | |
| 97 "//base:base_java", | |
| 98 ] | |
| 99 srcjar_deps = [ ":java_enums_srcjar" ] | |
| 100 } | |
| 101 | |
| 102 java_cpp_enum("java_enums_srcjar") { | |
| 103 sources = [ | |
| 104 "gamepad_standard_mappings.h", | |
| 105 ] | |
| 106 } | |
| 107 } | |
| OLD | NEW |