1# Copyright (c) 2022 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14if (defined(ohos_lite)) { 15 import("//build/lite/config/component/lite_component.gni") 16 import("//build/lite/config/test.gni") 17 import("//drivers/peripheral/audio/audio.gni") 18} else { 19 import("//build/ohos.gni") 20 import("//build/test.gni") 21 import("//drivers/hdf_core/adapter/uhdf2/uhdf.gni") 22 import("//drivers/peripheral/audio/audio.gni") 23} 24 25if (defined(ohos_lite)) { 26 unittest("hdf_audio_hdi_headset_test") { 27 sources = [ "//drivers/peripheral/audio/test/unittest/hdi/jack/src/analog_headset_test.cpp" ] 28 29 include_dirs = [ 30 "//drivers/peripheral/audio/test/unittest/hdi/jack/include", 31 "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", 32 "//drivers/hdf_core/adapter/uhdf/posix/include", 33 "//drivers/hdf_core/framework/include", 34 "//drivers/hdf_core/framework/include/core", 35 "//drivers/hdf_core/framework/include/osal", 36 "//drivers/hdf_core/framework/include/platform", 37 "//drivers/hdf_core/framework/include/utils", 38 "//drivers/hdf_core/framework/utils/include", 39 "//drivers/hdf_core/framework/test/unittest/include", 40 "//drivers/peripheral/input/hal/include", 41 "//drivers/peripheral/input/interfaces/include", 42 "//third_party/bounds_checking_function/include", 43 "//third_party/FreeBSD/sys/dev/evdev", 44 ] 45 46 deps = [ 47 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 48 "//drivers/hdf_core/adapter/uhdf/manager:hdf_core", 49 "//drivers/hdf_core/adapter/uhdf/platform:hdf_platform", 50 "//drivers/hdf_core/adapter/uhdf/posix:hdf_posix_osal", 51 "//drivers/hdf_core/adapter/uhdf/test/unittest/common:hdf_test_common", 52 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio", 53 "//drivers/peripheral/input/hal:hdi_input", 54 ] 55 public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 56 cflags = [ 57 "-Wall", 58 "-Wextra", 59 "-Werror", 60 "-fsigned-char", 61 "-fno-common", 62 "-fno-strict-aliasing", 63 "-std=c++11", 64 ] 65 if (ohos_build_compiler != "clang") { 66 cflags += [ 67 "-Wno-format", 68 "-Wno-format-extra-args", 69 ] 70 } 71 } 72} else { 73 module_output_path = "hdf/audio/hal" 74 ohos_unittest("hdf_audio_hdi_headset_test") { 75 module_out_path = module_output_path 76 sources = [ "//drivers/peripheral/audio/test/unittest/hdi/jack/src/analog_headset_test.cpp" ] 77 78 include_dirs = 79 [ "//drivers/peripheral/audio/test/unittest/hdi/jack/include" ] 80 81 deps = [ 82 "$hdf_uhdf_path/utils:libhdf_utils", 83 "//drivers/hdf_core/adapter/build/test_common:libhdf_test_common", 84 "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio_common", 85 "//drivers/peripheral/input/hal:hdi_input", 86 ] 87 if (!drivers_peripheral_audio_user_mode) { 88 deps += [ "//drivers/peripheral/audio/hal/hdi_passthrough:hdi_audio" ] 89 } else { 90 deps += [ "//device/soc/${product_company}/common/hal/media:hdi_audio" ] 91 } 92 93 if (is_standard_system) { 94 external_deps = [ 95 "c_utils:utils", 96 "hdf_core:libhdf_utils", 97 "hiviewdfx_hilog_native:libhilog", 98 ] 99 } else { 100 external_deps = [ 101 "hdf_core:libhdf_utils", 102 "hilog:libhilog", 103 ] 104 } 105 cflags = [ 106 "-Wall", 107 "-Wextra", 108 "-Werror", 109 "-fsigned-char", 110 "-fno-common", 111 "-fno-strict-aliasing", 112 ] 113 } 114} 115