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.
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")
13 import("//build/config/android/rules.gni")
16 # Common configuration for targets in the media/midi directory.
17 config("midi_config") {
18 if (use_alsa && use_udev) {
28 # USB MIDI specific source files that are used in Android port, and unit tests.
29 # These can't easily be a source set because "midi" is a component and the
30 # component export flags must always be the same.
32 "midi_manager_usb.cc",
34 "usb_midi_descriptor_parser.cc",
35 "usb_midi_descriptor_parser.h",
38 "usb_midi_input_stream.cc",
39 "usb_midi_input_stream.h",
41 "usb_midi_output_stream.cc",
42 "usb_midi_output_stream.h",
45 # Android specific Java source files that are used to generate jni header files.
47 android_library("midi_java") {
52 DEPRECATED_java_in_dir = "java/src"
55 generate_jni("midi_jni_headers") {
57 "java/src/org/chromium/media/midi/MidiDeviceAndroid.java",
58 "java/src/org/chromium/media/midi/MidiInputPortAndroid.java",
59 "java/src/org/chromium/media/midi/MidiManagerAndroid.java",
60 "java/src/org/chromium/media/midi/MidiOutputPortAndroid.java",
61 "java/src/org/chromium/media/midi/UsbMidiDeviceAndroid.java",
62 "java/src/org/chromium/media/midi/UsbMidiDeviceFactoryAndroid.java",
64 jni_package = "media/midi"
73 "midi_manager_mac.cc",
75 "midi_manager_win.cc",
77 "midi_message_queue.cc",
78 "midi_message_queue.h",
79 "midi_message_util.cc",
80 "midi_message_util.h",
89 configs += [ ":midi_config" ]
91 defines = [ "MIDI_IMPLEMENTATION" ]
98 # TODO(yhirano): Consider having "android" subdirectory.
100 "midi_device_android.cc",
101 "midi_device_android.h",
102 "midi_jni_registrar.cc",
103 "midi_jni_registrar.h",
104 "midi_input_port_android.cc",
105 "midi_input_port_android.h",
106 "midi_manager_android.cc",
107 "midi_manager_android.h",
108 "midi_output_port_android.cc",
109 "midi_output_port_android.h",
110 "usb_midi_device_android.cc",
111 "usb_midi_device_android.h",
112 "usb_midi_device_factory_android.cc",
113 "usb_midi_device_factory_android.h",
116 # Since the USB sources are part of the component.
117 defines += [ "EXPORT_USB_MIDI" ]
127 "CoreAudio.framework",
128 "CoreMIDI.framework",
133 deps += [ "//device/usb" ]
136 if (use_alsa && use_udev) {
143 "midi_manager_alsa.cc",
144 "midi_manager_alsa.h",
149 deps += [ "//device/udev_linux" ]
153 # TODO(GYP): Delete this after we've converted everything to GN.
154 # The _run targets exist only for compatibility w/ GYP.
155 group("midi_unittests_run") {
162 test("midi_unittests") {
164 "midi_manager_unittest.cc",
165 "midi_manager_usb_unittest.cc",
166 "midi_message_queue_unittest.cc",
167 "midi_message_util_unittest.cc",
168 "usb_midi_descriptor_parser_unittest.cc",
169 "usb_midi_input_stream_unittest.cc",
170 "usb_midi_output_stream_unittest.cc",
173 configs += [ ":midi_config" ]
176 "//base/test/:run_all_unittests",
177 "//base/test/:test_support",
182 isolate_file = "midi_unittests.isolate"
186 sources += usb_midi_sources
190 sources += [ "midi_manager_mac_unittest.cc" ]
193 if (use_alsa && use_udev) {
194 sources += [ "midi_manager_alsa_unittest.cc" ]
198 deps += [ "//tools/xdisplaycheck" ]