OLD | NEW |
(Empty) | |
| 1 # Copyright 2015 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/android/config.gni") |
| 6 import("//build/config/features.gni") |
| 7 import("//build/config/ui.gni") |
| 8 import("//media/media_options.gni") |
| 9 import("//testing/test.gni") |
| 10 |
| 11 if (is_android) { |
| 12 # For generate_jni(). |
| 13 import("//build/config/android/rules.gni") |
| 14 } |
| 15 |
| 16 # Common configuration for targets in the media/midi directory. |
| 17 config("midi_config") { |
| 18 if (use_alsa) { |
| 19 defines = [ |
| 20 "USE_ALSA", |
| 21 "USE_UDEV", |
| 22 ] |
| 23 } |
| 24 |
| 25 visibility = [ ":*" ] |
| 26 } |
| 27 |
| 28 # USB MIDI specific source files that are used in Android port, and unit tests. |
| 29 source_set("usb_midi") { |
| 30 sources = [ |
| 31 "midi_manager_usb.cc", |
| 32 "midi_manager_usb.h", |
| 33 "usb_midi_descriptor_parser.cc", |
| 34 "usb_midi_descriptor_parser.h", |
| 35 "usb_midi_device.h", |
| 36 "usb_midi_input_stream.cc", |
| 37 "usb_midi_input_stream.h", |
| 38 "usb_midi_jack.h", |
| 39 "usb_midi_output_stream.cc", |
| 40 "usb_midi_output_stream.h", |
| 41 ] |
| 42 |
| 43 defines = [ "MEDIA_IMPLEMENTATION" ] |
| 44 deps = [ |
| 45 "//base", |
| 46 ] |
| 47 } |
| 48 |
| 49 # Android specific Java source files that are used to generate jni header files. |
| 50 if (is_android) { |
| 51 android_library("midi_java") { |
| 52 deps = [ |
| 53 "//base:base_java", |
| 54 ] |
| 55 |
| 56 DEPRECATED_java_in_dir = "java/src" |
| 57 } |
| 58 |
| 59 generate_jni("midi_jni_headers") { |
| 60 sources = [ |
| 61 "java/src/org/chromium/media/midi/UsbMidiDeviceAndroid.java", |
| 62 "java/src/org/chromium/media/midi/UsbMidiDeviceFactoryAndroid.java", |
| 63 ] |
| 64 jni_package = "media/midi" |
| 65 } |
| 66 } |
| 67 |
| 68 component("midi") { |
| 69 sources = [ |
| 70 "midi_manager.cc", |
| 71 "midi_manager.h", |
| 72 "midi_manager_mac.cc", |
| 73 "midi_manager_mac.h", |
| 74 "midi_manager_win.cc", |
| 75 "midi_manager_win.h", |
| 76 "midi_message_queue.cc", |
| 77 "midi_message_queue.h", |
| 78 "midi_message_util.cc", |
| 79 "midi_message_util.h", |
| 80 "midi_port_info.cc", |
| 81 "midi_port_info.h", |
| 82 "midi_scheduler.cc", |
| 83 "midi_scheduler.h", |
| 84 ] |
| 85 |
| 86 configs += [ ":midi_config" ] |
| 87 |
| 88 defines = [ "MEDIA_IMPLEMENTATION" ] |
| 89 deps = [] |
| 90 libs = [] |
| 91 |
| 92 if (is_android) { |
| 93 sources += [ |
| 94 "midi_jni_registrar.cc", |
| 95 "midi_jni_registrar.h", |
| 96 "midi_manager_android.cc", |
| 97 "usb_midi_device_android.cc", |
| 98 "usb_midi_device_android.h", |
| 99 "usb_midi_device_factory_android.cc", |
| 100 "usb_midi_device_factory_android.h", |
| 101 ] |
| 102 |
| 103 deps += [ |
| 104 "//base:i18n", |
| 105 ":midi_jni_headers", |
| 106 ":usb_midi", |
| 107 ] |
| 108 } |
| 109 |
| 110 if (is_mac) { |
| 111 libs += [ |
| 112 "CoreAudio.framework", |
| 113 "CoreMIDI.framework", |
| 114 ] |
| 115 } |
| 116 |
| 117 if (is_win) { |
| 118 deps += [ "//device/usb" ] |
| 119 } |
| 120 |
| 121 if (use_alsa && use_udev) { |
| 122 deps += [ |
| 123 "//crypto", |
| 124 "//crypto:platform", |
| 125 ] |
| 126 libs += [ "asound" ] |
| 127 sources += [ |
| 128 "midi_manager_alsa.cc", |
| 129 "midi_manager_alsa.h", |
| 130 ] |
| 131 } |
| 132 |
| 133 if (use_udev) { |
| 134 deps += [ "//device/udev_linux" ] |
| 135 } |
| 136 } |
| 137 |
| 138 test("midi_unittests") { |
| 139 sources = [ |
| 140 "midi_manager_unittest.cc", |
| 141 "midi_manager_usb_unittest.cc", |
| 142 "midi_message_queue_unittest.cc", |
| 143 "midi_message_util_unittest.cc", |
| 144 "usb_midi_descriptor_parser_unittest.cc", |
| 145 "usb_midi_input_stream_unittest.cc", |
| 146 "usb_midi_output_stream_unittest.cc", |
| 147 ] |
| 148 |
| 149 configs += [ ":midi_config" ] |
| 150 deps = [ |
| 151 ":midi", |
| 152 "//base/test/:run_all_unittests", |
| 153 "//base/test/:test_support", |
| 154 "//testing/gtest", |
| 155 ] |
| 156 |
| 157 if (!is_android) { |
| 158 deps += [ ":usb_midi" ] |
| 159 } |
| 160 |
| 161 if (is_mac) { |
| 162 sources += [ "midi_manager_mac_unittest.cc" ] |
| 163 } |
| 164 |
| 165 if (use_alsa && use_udev) { |
| 166 sources += [ "midi_manager_alsa_unittest.cc" ] |
| 167 } |
| 168 |
| 169 if (use_x11) { |
| 170 deps += [ "//tools/xdisplaycheck" ] |
| 171 } |
| 172 } |
OLD | NEW |