• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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
14import("//build/ohos.gni")
15import("//drivers/adapter/uhdf2/uhdf.gni")
16import("//drivers/peripheral/audio/audio.gni")
17
18config("pathseltct_config") {
19  visibility = [ ":*" ]
20
21  cflags = [
22    "-Wall",
23    "-Wextra",
24    "-Werror",
25    "-DGST_DISABLE_DEPRECATED",
26    "-DHAVE_CONFIG_H",
27    "-fno-strict-aliasing",
28    "-Wno-sign-compare",
29    "-Wno-builtin-requires-header",
30    "-Wno-implicit-function-declaration",
31    "-Wno-format",
32    "-Wno-int-conversion",
33    "-Wno-unused-function",
34    "-Wno-unused-parameter",
35    "-Wno-thread-safety-attributes",
36    "-Wno-inconsistent-missing-override",
37    "-fno-rtti",
38    "-fno-exceptions",
39    "-ffunction-sections",
40    "-fdata-sections",
41  ]
42
43  ldflags = [ "-Wl" ]
44}
45
46if (defined(ohos_lite)) {
47  ohos_shared_library("hdi_audio_path_select") {
48    sources = [
49      "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_common.c",
50      "//third_party/cJSON/cJSON.c",
51      "src/audio_pathselect.c",
52    ]
53
54    include_dirs = [
55      "//drivers/peripheral/audio/hal/hdi_passthrough/include",
56      "//drivers/peripheral/audio/hal/pathselect/include",
57      "//third_party/cJSON",
58      "//drivers/peripheral/audio/interfaces/include",
59      "//third_party/bounds_checking_function/include",
60    ]
61
62    deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
63    external_deps = [ "device_driver_framework:libhdf_utils" ]
64    if (enable_audio_hal_hdf_log) {
65      defines = [ "AUDIO_HAL_HDF_LOG" ]
66    }
67
68    public_configs = [ ":pathseltct_config" ]
69    subsystem_name = "hdf"
70    part_name = "audio_device_driver"
71  }
72} else {
73  ohos_shared_library("hdi_audio_path_select") {
74    sources = [
75      "//drivers/peripheral/audio/hal/hdi_passthrough/src/audio_common.c",
76      "//third_party/cJSON/cJSON.c",
77      "src/audio_pathselect.c",
78    ]
79
80    include_dirs = [
81      "//drivers/peripheral/audio/hal/hdi_passthrough/include",
82      "//drivers/peripheral/audio/hal/pathselect/include",
83      "//third_party/cJSON",
84      "//drivers/peripheral/audio/interfaces/include",
85      "//third_party/bounds_checking_function/include",
86    ]
87
88    defines = []
89    if (enable_audio_hal_hdf_log) {
90      defines += [ "AUDIO_HAL_HDF_LOG" ]
91    }
92
93    if (is_standard_system) {
94      external_deps = [
95        "device_driver_framework:libhdf_host",
96        "device_driver_framework:libhdf_ipc_adapter",
97        "device_driver_framework:libhdf_utils",
98        "device_driver_framework:libhdi",
99        "hiviewdfx_hilog_native:libhilog",
100        "utils_base:utils",
101      ]
102    } else {
103      external_deps = [ "hilog:libhilog" ]
104    }
105
106    public_configs = [ ":pathseltct_config" ]
107
108    install_images = [ chipset_base_dir ]
109    subsystem_name = "hdf"
110    part_name = "audio_device_driver"
111  }
112}
113