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 test("midi_unittests") {
141 "midi_manager_unittest.cc",
142 "midi_manager_usb_unittest.cc",
143 "midi_message_queue_unittest.cc",
144 "midi_message_util_unittest.cc",
145 "usb_midi_descriptor_parser_unittest.cc",
146 "usb_midi_input_stream_unittest.cc",
147 "usb_midi_output_stream_unittest.cc",
150 configs += [ ":midi_config" ]
153 "//base/test/:run_all_unittests",
154 "//base/test/:test_support",
159 isolate_file = "midi_unittests.isolate"
163 sources += usb_midi_sources
167 sources += [ "midi_manager_mac_unittest.cc" ]
170 if (use_alsa && use_udev) {
171 sources += [ "midi_manager_alsa_unittest.cc" ]
175 deps += [ "//tools/xdisplaycheck" ]