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") {
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/UsbMidiDeviceAndroid.java",
58 "java/src/org/chromium/media/midi/UsbMidiDeviceFactoryAndroid.java",
60 jni_package = "media/midi"
69 "midi_manager_mac.cc",
71 "midi_manager_win.cc",
73 "midi_message_queue.cc",
74 "midi_message_queue.h",
75 "midi_message_util.cc",
76 "midi_message_util.h",
83 configs += [ ":midi_config" ]
85 defines = [ "MIDI_IMPLEMENTATION" ]
93 "midi_jni_registrar.cc",
94 "midi_jni_registrar.h",
95 "midi_manager_android.cc",
96 "usb_midi_device_android.cc",
97 "usb_midi_device_android.h",
98 "usb_midi_device_factory_android.cc",
99 "usb_midi_device_factory_android.h",
102 # Since the USB sources are part of the component.
103 defines += [ "EXPORT_USB_MIDI" ]
113 "CoreAudio.framework",
114 "CoreMIDI.framework",
119 deps += [ "//device/usb" ]
122 if (use_alsa && use_udev) {
129 "midi_manager_alsa.cc",
130 "midi_manager_alsa.h",
135 deps += [ "//device/udev_linux" ]
139 # TODO(GYP): Delete this after we've converted everything to GN.
140 # The _run targets exist only for compatibility w/ GYP.
141 group("midi_unittests_run") {
148 test("midi_unittests") {
150 "midi_manager_unittest.cc",
151 "midi_manager_usb_unittest.cc",
152 "midi_message_queue_unittest.cc",
153 "midi_message_util_unittest.cc",
154 "usb_midi_descriptor_parser_unittest.cc",
155 "usb_midi_input_stream_unittest.cc",
156 "usb_midi_output_stream_unittest.cc",
159 configs += [ ":midi_config" ]
162 "//base/test/:run_all_unittests",
163 "//base/test/:test_support",
168 isolate_file = "midi_unittests.isolate"
172 sources += usb_midi_sources
176 sources += [ "midi_manager_mac_unittest.cc" ]
179 if (use_alsa && use_udev) {
180 sources += [ "midi_manager_alsa_unittest.cc" ]
184 deps += [ "//tools/xdisplaycheck" ]