| # Copyright 2022 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/components.gni") |
| import("//build/testing/cc_test_executable.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":audio_lib_format2_unittests" ] |
| } |
| |
| source_set("fixed") { |
| sources = [ "fixed.h" ] |
| public_deps = [ "//zircon/system/ulib/ffl" ] |
| } |
| |
| source_set("format2") { |
| sources = [ |
| "channel_mapper.h", |
| "format.cc", |
| "format.h", |
| "sample_converter.h", |
| "stream_converter.cc", |
| "stream_converter.h", |
| ] |
| |
| public_deps = [ |
| ":fixed", |
| "//sdk/fidl/fuchsia.audio:fuchsia.audio_cpp", |
| "//sdk/fidl/fuchsia.media:fuchsia.media_cpp", |
| "//sdk/fidl/fuchsia.mediastreams:fuchsia.mediastreams_cpp", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/fit-promise", |
| "//src/media/audio/lib/timeline", |
| ] |
| |
| deps = [ "//sdk/lib/syslog/cpp" ] |
| |
| # Building without optimizations causes significant slowdowns for these components; the additional |
| # CPU load may lead to audio glitches on debug builds. These config settings enable the needed |
| # code optimization while maintaining other 'debug' aspects (e.g. DCHECK is still enabled). |
| configs -= [ "//build/config:default_optimize" ] |
| configs += [ "//build/config:optimize_speed" ] |
| |
| # Allow some of our loops to be vectorized by the compiler. |
| configs += [ "//build/config:fast-math" ] |
| } |
| |
| cc_test_executable("unittest-bin") { |
| visibility = [ ":*" ] |
| testonly = true |
| output_name = "audio_lib_format2_unittests" |
| |
| sources = [ |
| "channel_mapper_unittest.cc", |
| "format_unittest.cc", |
| "sample_converter_unittest.cc", |
| "stream_converter_unittest.cc", |
| ] |
| |
| deps = [ |
| ":format2", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gmock", |
| ] |
| } |
| |
| fuchsia_unittest_package("audio_lib_format2_unittests") { |
| deps = [ ":unittest-bin" ] |
| } |