• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
14import("//build/ohos.gni")
15
16declare_args() {
17  alsa_lib_feature_config_enable = false
18}
19
20config("alsa_lib_header") {
21  include_dirs = [
22    "//third_party/alsa-lib/include",
23    "//third_party/alsa-lib/include/sound",
24    "//third_party/alsa-lib/include/uapi",
25    "//third_party/alsa-lib/src/pcm",
26    "//third_party/alsa-lib/src/ucm",
27    "//third_party/alsa-lib/src/mixer",
28    "//third_party/alsa-lib/src/seq",
29    "//third_party/alsa-lib/src/hwdep",
30    "//third_party/alsa-lib/src/rawmidi",
31    "//third_party/alsa-lib/src/control",
32    "//third_party/alsa-lib/src/timer",
33    "{target_gen_dir}/include/",
34  ]
35}
36
37config("alsa_lib_config") {
38  cflags = [
39    "-Wno-sign-compare",
40    "-Wno-implicit-function-declaration",
41    "-Wno-parentheses",
42    "-Wno-string-conversion",
43    "-Wno-string-plus-int",
44    "-Wno-asm-operand-widths",
45    "-Wno-pointer-sign",
46    "-Wno-deprecated-declarations",
47    "-Wno-implicit-int",
48    "-Wno-switch",
49    "-Wno-incompatible-pointer-types-discards-qualifiers",
50    "-Wno-int-conversion",
51    "-Wno-absolute-value",
52    "-Wno-unused-function",
53    "-Wno-unused-label",
54    "-Wno-unused-const-variable",
55    "-Wno-visibility",
56    "-Wno-incompatible-pointer-types",
57    "-Wno-sometimes-uninitialized",
58    "-Wno-format",
59    "-Wno-tautological-constant-out-of-range-compare",
60    "-Wno-implicit-fallthrough",
61    "-Wno-error",
62    "-D_GNU_SOURCE",
63    "-DHAVE_CONFIG_H",
64  ]
65
66  if (use_musl) {
67    cflags += [ "-Wno-bool-operation" ]
68  }
69}
70
71ohos_shared_library("libasound") {
72  sources = [
73    "//third_party/alsa-lib/src/async.c",
74    "//third_party/alsa-lib/src/conf.c",
75    "//third_party/alsa-lib/src/confeval.c",
76    "//third_party/alsa-lib/src/confmisc.c",
77    "//third_party/alsa-lib/src/control/cards.c",
78    "//third_party/alsa-lib/src/control/control.c",
79    "//third_party/alsa-lib/src/control/control_empty.c",
80    "//third_party/alsa-lib/src/control/control_ext.c",
81    "//third_party/alsa-lib/src/control/control_hw.c",
82    "//third_party/alsa-lib/src/control/control_plugin.c",
83    "//third_party/alsa-lib/src/control/control_remap.c",
84    "//third_party/alsa-lib/src/control/control_shm.c",
85    "//third_party/alsa-lib/src/control/control_symbols.c",
86    "//third_party/alsa-lib/src/control/ctlparse.c",
87    "//third_party/alsa-lib/src/control/eld.c",
88    "//third_party/alsa-lib/src/control/hcontrol.c",
89    "//third_party/alsa-lib/src/control/namehint.c",
90    "//third_party/alsa-lib/src/control/setup.c",
91    "//third_party/alsa-lib/src/control/tlv.c",
92    "//third_party/alsa-lib/src/dlmisc.c",
93    "//third_party/alsa-lib/src/error.c",
94    "//third_party/alsa-lib/src/hwdep/hwdep.c",
95    "//third_party/alsa-lib/src/hwdep/hwdep_hw.c",
96    "//third_party/alsa-lib/src/hwdep/hwdep_symbols.c",
97    "//third_party/alsa-lib/src/input.c",
98    "//third_party/alsa-lib/src/mixer/bag.c",
99    "//third_party/alsa-lib/src/mixer/mixer.c",
100    "//third_party/alsa-lib/src/mixer/simple.c",
101    "//third_party/alsa-lib/src/mixer/simple_abst.c",
102    "//third_party/alsa-lib/src/mixer/simple_none.c",
103    "//third_party/alsa-lib/src/names.c",
104    "//third_party/alsa-lib/src/output.c",
105    "//third_party/alsa-lib/src/pcm/interval.c",
106    "//third_party/alsa-lib/src/pcm/mask.c",
107    "//third_party/alsa-lib/src/pcm/pcm.c",
108    "//third_party/alsa-lib/src/pcm/pcm_adpcm.c",
109    "//third_party/alsa-lib/src/pcm/pcm_alaw.c",
110    "//third_party/alsa-lib/src/pcm/pcm_asym.c",
111    "//third_party/alsa-lib/src/pcm/pcm_copy.c",
112    "//third_party/alsa-lib/src/pcm/pcm_direct.c",
113    "//third_party/alsa-lib/src/pcm/pcm_dmix.c",
114    "//third_party/alsa-lib/src/pcm/pcm_dshare.c",
115    "//third_party/alsa-lib/src/pcm/pcm_dsnoop.c",
116    "//third_party/alsa-lib/src/pcm/pcm_empty.c",
117    "//third_party/alsa-lib/src/pcm/pcm_extplug.c",
118    "//third_party/alsa-lib/src/pcm/pcm_file.c",
119    "//third_party/alsa-lib/src/pcm/pcm_generic.c",
120    "//third_party/alsa-lib/src/pcm/pcm_hooks.c",
121    "//third_party/alsa-lib/src/pcm/pcm_hw.c",
122    "//third_party/alsa-lib/src/pcm/pcm_iec958.c",
123    "//third_party/alsa-lib/src/pcm/pcm_ioplug.c",
124    "//third_party/alsa-lib/src/pcm/pcm_ladspa.c",
125    "//third_party/alsa-lib/src/pcm/pcm_lfloat.c",
126    "//third_party/alsa-lib/src/pcm/pcm_linear.c",
127    "//third_party/alsa-lib/src/pcm/pcm_meter.c",
128    "//third_party/alsa-lib/src/pcm/pcm_misc.c",
129    "//third_party/alsa-lib/src/pcm/pcm_mmap.c",
130    "//third_party/alsa-lib/src/pcm/pcm_mmap_emul.c",
131    "//third_party/alsa-lib/src/pcm/pcm_mulaw.c",
132    "//third_party/alsa-lib/src/pcm/pcm_multi.c",
133    "//third_party/alsa-lib/src/pcm/pcm_null.c",
134    "//third_party/alsa-lib/src/pcm/pcm_params.c",
135    "//third_party/alsa-lib/src/pcm/pcm_plug.c",
136    "//third_party/alsa-lib/src/pcm/pcm_plugin.c",
137    "//third_party/alsa-lib/src/pcm/pcm_rate.c",
138    "//third_party/alsa-lib/src/pcm/pcm_rate_linear.c",
139    "//third_party/alsa-lib/src/pcm/pcm_route.c",
140    "//third_party/alsa-lib/src/pcm/pcm_share.c",
141    "//third_party/alsa-lib/src/pcm/pcm_shm.c",
142    "//third_party/alsa-lib/src/pcm/pcm_simple.c",
143    "//third_party/alsa-lib/src/pcm/pcm_softvol.c",
144    "//third_party/alsa-lib/src/pcm/pcm_symbols.c",
145    "//third_party/alsa-lib/src/rawmidi/rawmidi.c",
146    "//third_party/alsa-lib/src/rawmidi/rawmidi_hw.c",
147    "//third_party/alsa-lib/src/rawmidi/rawmidi_symbols.c",
148    "//third_party/alsa-lib/src/rawmidi/rawmidi_virt.c",
149    "//third_party/alsa-lib/src/seq/seq.c",
150    "//third_party/alsa-lib/src/seq/seq_event.c",
151    "//third_party/alsa-lib/src/seq/seq_hw.c",
152    "//third_party/alsa-lib/src/seq/seq_midi_event.c",
153    "//third_party/alsa-lib/src/seq/seq_old.c",
154    "//third_party/alsa-lib/src/seq/seq_symbols.c",
155    "//third_party/alsa-lib/src/seq/seqmid.c",
156    "//third_party/alsa-lib/src/shmarea.c",
157    "//third_party/alsa-lib/src/socket.c",
158    "//third_party/alsa-lib/src/timer/timer.c",
159    "//third_party/alsa-lib/src/timer/timer_hw.c",
160    "//third_party/alsa-lib/src/timer/timer_query.c",
161    "//third_party/alsa-lib/src/timer/timer_query_hw.c",
162    "//third_party/alsa-lib/src/timer/timer_symbols.c",
163    "//third_party/alsa-lib/src/ucm/main.c",
164    "//third_party/alsa-lib/src/ucm/parser.c",
165    "//third_party/alsa-lib/src/ucm/ucm_cond.c",
166    "//third_party/alsa-lib/src/ucm/ucm_exec.c",
167    "//third_party/alsa-lib/src/ucm/ucm_include.c",
168    "//third_party/alsa-lib/src/ucm/ucm_regex.c",
169    "//third_party/alsa-lib/src/ucm/ucm_subs.c",
170    "//third_party/alsa-lib/src/ucm/utils.c",
171    "//third_party/alsa-lib/src/userfile.c",
172  ]
173
174  include_dirs = [
175    "//third_party/alsa-lib/include",
176    "//third_party/alsa-lib/include/sound",
177    "//third_party/alsa-lib/include/uapi",
178    "//third_party/alsa-lib/src/pcm",
179    "//third_party/alsa-lib/src/ucm",
180    "//third_party/alsa-lib/src/mixer",
181    "//third_party/alsa-lib/src/seq",
182    "//third_party/alsa-lib/src/hwdep",
183    "//third_party/alsa-lib/src/rawmidi",
184    "//third_party/alsa-lib/src/control",
185    "//third_party/alsa-lib/src/timer",
186    "{target_gen_dir}/include/",
187  ]
188
189  configs = [ ":alsa_lib_config" ]
190  if (alsa_lib_feature_config_enable) {
191    deps = [
192      # conf files
193      "src/conf:alsa-lib-prebuilt-all",
194    ]
195  }
196
197  public_configs = [ ":alsa_lib_header" ]
198  output_extension = "so"
199  install_images = [ chipset_base_dir ]
200  install_enable = true
201  part_name = "alsa-lib"
202  subsystem_name = "thirdparty"
203}
204