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