1# Copyright (c) 2021-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 16pulseaudio_dir = "//third_party/pulseaudio" 17pulseaudio_build_path = "//third_party/pulseaudio/ohosbuild" 18libsndfile_dir = "//third_party/libsnd" 19libsndfile_build_path = "//third_party/libsnd" 20 21config("pulsecommon_config") { 22 visibility = [ ":*" ] 23 24 include_dirs = [ 25 "$pulseaudio_dir/src", 26 "$pulseaudio_dir/include", 27 "$pulseaudio_dir", 28 "$pulseaudio_build_path/src", 29 "$pulseaudio_build_path/include", 30 "$libsndfile_dir/include", 31 "$pulseaudio_dir/src/pulse", 32 "//base/startup/init/interfaces/innerkits/include", 33 ] 34 35 cflags = [ 36 "-Wall", 37 "-Werror", 38 "-Wno-implicit-function-declaration", 39 "-Wno-unused-function", 40 "-DHAVE_CONFIG_H", 41 "-D_GNU_SOURCE", 42 ] 43} 44 45ohos_source_set("pulsecommon_sources") { 46 sources = [ 47 "$pulseaudio_dir/src/pulse/channelmap.c", 48 "$pulseaudio_dir/src/pulse/client-conf.c", 49 "$pulseaudio_dir/src/pulse/error.c", 50 "$pulseaudio_dir/src/pulse/fork-detect.c", 51 "$pulseaudio_dir/src/pulse/format.c", 52 "$pulseaudio_dir/src/pulse/json.c", 53 "$pulseaudio_dir/src/pulse/mainloop-api.c", 54 "$pulseaudio_dir/src/pulse/ohos_pa_volume.c", 55 "$pulseaudio_dir/src/pulse/proplist.c", 56 "$pulseaudio_dir/src/pulse/rtclock.c", 57 "$pulseaudio_dir/src/pulse/sample.c", 58 "$pulseaudio_dir/src/pulse/timeval.c", 59 "$pulseaudio_dir/src/pulse/utf8.c", 60 "$pulseaudio_dir/src/pulse/util.c", 61 "$pulseaudio_dir/src/pulse/xmalloc.c", 62 "$pulseaudio_dir/src/pulsecore/arpa-inet.c", 63 "$pulseaudio_dir/src/pulsecore/aupdate.c", 64 "$pulseaudio_dir/src/pulsecore/authkey.c", 65 "$pulseaudio_dir/src/pulsecore/bitset.c", 66 "$pulseaudio_dir/src/pulsecore/conf-parser.c", 67 "$pulseaudio_dir/src/pulsecore/core-error.c", 68 "$pulseaudio_dir/src/pulsecore/core-format.c", 69 "$pulseaudio_dir/src/pulsecore/core-rtclock.c", 70 "$pulseaudio_dir/src/pulsecore/core-util.c", 71 "$pulseaudio_dir/src/pulsecore/dynarray.c", 72 "$pulseaudio_dir/src/pulsecore/fdsem.c", 73 "$pulseaudio_dir/src/pulsecore/flist.c", 74 "$pulseaudio_dir/src/pulsecore/g711.c", 75 "$pulseaudio_dir/src/pulsecore/hashmap.c", 76 "$pulseaudio_dir/src/pulsecore/i18n.c", 77 "$pulseaudio_dir/src/pulsecore/idxset.c", 78 "$pulseaudio_dir/src/pulsecore/iochannel.c", 79 "$pulseaudio_dir/src/pulsecore/ioline.c", 80 "$pulseaudio_dir/src/pulsecore/ipacl.c", 81 "$pulseaudio_dir/src/pulsecore/lock-autospawn.c", 82 "$pulseaudio_dir/src/pulsecore/log.c", 83 "$pulseaudio_dir/src/pulsecore/mcalign.c", 84 "$pulseaudio_dir/src/pulsecore/memblock.c", 85 "$pulseaudio_dir/src/pulsecore/memblockq.c", 86 "$pulseaudio_dir/src/pulsecore/memchunk.c", 87 "$pulseaudio_dir/src/pulsecore/memtrap.c", 88 "$pulseaudio_dir/src/pulsecore/mutex-posix.c", 89 "$pulseaudio_dir/src/pulsecore/native-common.c", 90 "$pulseaudio_dir/src/pulsecore/ohos_socket-server.c", 91 "$pulseaudio_dir/src/pulsecore/once.c", 92 "$pulseaudio_dir/src/pulsecore/packet.c", 93 "$pulseaudio_dir/src/pulsecore/parseaddr.c", 94 "$pulseaudio_dir/src/pulsecore/pdispatch.c", 95 "$pulseaudio_dir/src/pulsecore/pid.c", 96 "$pulseaudio_dir/src/pulsecore/pipe.c", 97 "$pulseaudio_dir/src/pulsecore/proplist-util.c", 98 "$pulseaudio_dir/src/pulsecore/pstream-util.c", 99 "$pulseaudio_dir/src/pulsecore/pstream.c", 100 "$pulseaudio_dir/src/pulsecore/queue.c", 101 "$pulseaudio_dir/src/pulsecore/random.c", 102 "$pulseaudio_dir/src/pulsecore/ratelimit.c", 103 "$pulseaudio_dir/src/pulsecore/sample-util.c", 104 "$pulseaudio_dir/src/pulsecore/semaphore-posix.c", 105 "$pulseaudio_dir/src/pulsecore/shm.c", 106 "$pulseaudio_dir/src/pulsecore/sndfile-util.c", 107 "$pulseaudio_dir/src/pulsecore/socket-client.c", 108 "$pulseaudio_dir/src/pulsecore/socket-util.c", 109 "$pulseaudio_dir/src/pulsecore/srbchannel.c", 110 "$pulseaudio_dir/src/pulsecore/strbuf.c", 111 "$pulseaudio_dir/src/pulsecore/strlist.c", 112 "$pulseaudio_dir/src/pulsecore/tagstruct.c", 113 "$pulseaudio_dir/src/pulsecore/thread-posix.c", 114 "$pulseaudio_dir/src/pulsecore/time-smoother.c", 115 "$pulseaudio_dir/src/pulsecore/tokenizer.c", 116 "$pulseaudio_dir/src/pulsecore/usergroup.c", 117 ] 118 119 configs = [ ":pulsecommon_config" ] 120 121 subsystem_name = "multimedia" 122 part_name = "multimedia_audio_framework" 123} 124 125ohos_shared_library("pulsecommon") { 126 deps = [ 127 ":pulsecommon_sources", 128 "$libsndfile_build_path:sndfile", 129 ] 130 131 external_deps = [ "init:libbegetutil" ] 132 133 subsystem_name = "multimedia" 134 part_name = "multimedia_audio_framework" 135} 136ohos_prebuilt_etc("pa_daemon_config") { 137 source = "$pulseaudio_dir/conf/daemon.conf" 138 139 subsystem_name = "multimedia" 140 module_install_dir = "etc/pulse" 141 part_name = "multimedia_audio_framework" 142} 143 144ohos_prebuilt_etc("pa_default_config") { 145 source = "$pulseaudio_dir/conf/default.pa" 146 subsystem_name = "multimedia" 147 module_install_dir = "etc/pulse" 148 part_name = "multimedia_audio_framework" 149} 150 151ohos_prebuilt_etc("pa_client_config") { 152 source = "$pulseaudio_dir/conf/client.conf" 153 subsystem_name = "multimedia" 154 module_install_dir = "etc/pulse" 155 part_name = "multimedia_audio_framework" 156} 157