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" 18 19group("native-modules") { 20 deps = [ 21 ":module-cli-protocol-unix", 22 ":module-native-protocol-fd", 23 ":module-native-protocol-tcp", 24 ":module-native-protocol-unix", 25 ":module-suspend-on-idle", 26 ] 27} 28 29group("common_deps") { 30 deps = [ 31 "$pulseaudio_build_path/src:pulsecommon", 32 "$pulseaudio_build_path/src/pulsecore:pulsecore", 33 ] 34} 35 36config("common_config") { 37 visibility = [ ":*" ] 38 39 include_dirs = [ 40 "$pulseaudio_dir/include", 41 "$pulseaudio_dir/src/modules", 42 "$pulseaudio_dir/src", 43 "$pulseaudio_dir", 44 "$pulseaudio_build_path/src", 45 "$pulseaudio_build_path/include", 46 ] 47 48 cflags = [ 49 "-Wall", 50 "-Werror", 51 "-DHAVE_CONFIG_H", 52 "-D_GNU_SOURCE", 53 "-D__INCLUDED_FROM_PULSE_AUDIO", 54 ] 55} 56 57ohos_shared_library("module-native-protocol-fd") { 58 sources = [ "$pulseaudio_dir/src/modules/module-native-protocol-fd.c" ] 59 cflags = [ "-DPA_MODULE_NAME=libmodule_native_protocol_fd_z_so" ] 60 ldflags = [ 61 "-Wl", 62 "--no-undefined", 63 ] 64 configs = [ ":common_config" ] 65 deps = [ 66 ":common_deps", 67 "$pulseaudio_build_path/src/pulsecore:protocol-native", 68 ] 69 70 subsystem_name = "multimedia" 71 part_name = "multimedia_audio_framework" 72} 73 74ohos_shared_library("module-native-protocol-tcp") { 75 sources = [ "$pulseaudio_dir/src/modules/ohos_module-protocol-stub.c" ] 76 cflags = [ 77 "-DPA_MODULE_NAME=libmodule_native_protocol_tcp_z_so", 78 "-DUSE_PROTOCOL_NATIVE", 79 "-DUSE_TCP_SOCKETS", 80 ] 81 ldflags = [ 82 "-Wl", 83 "--no-undefined", 84 ] 85 configs = [ ":common_config" ] 86 deps = [ 87 ":common_deps", 88 "$pulseaudio_build_path/src/pulsecore:protocol-native", 89 ] 90 91 subsystem_name = "multimedia" 92 part_name = "multimedia_audio_framework" 93} 94 95ohos_shared_library("module-native-protocol-unix") { 96 sources = [ "$pulseaudio_dir/src/modules/ohos_module-protocol-stub.c" ] 97 cflags = [ 98 "-DPA_MODULE_NAME=libmodule_native_protocol_unix_z_so", 99 "-DUSE_PROTOCOL_NATIVE", 100 "-DUSE_UNIX_SOCKETS", 101 ] 102 ldflags = [ 103 "-Wl", 104 "--no-undefined", 105 ] 106 configs = [ ":common_config" ] 107 deps = [ 108 ":common_deps", 109 "$pulseaudio_build_path/src/pulsecore:protocol-native", 110 ] 111 112 subsystem_name = "multimedia" 113 part_name = "multimedia_audio_framework" 114} 115 116ohos_shared_library("module-cli-protocol-unix") { 117 sources = [ "$pulseaudio_dir/src/modules/ohos_module-protocol-stub.c" ] 118 cflags = [ 119 "-DPA_MODULE_NAME=libmodule_cli_protocol_unix_z_so", 120 "-DUSE_PROTOCOL_CLI", 121 "-DUSE_UNIX_SOCKETS", 122 ] 123 ldflags = [ 124 "-Wl", 125 "--no-undefined", 126 ] 127 configs = [ ":common_config" ] 128 deps = [ 129 ":common_deps", 130 "$pulseaudio_build_path/src/pulsecore:protocol-cli", 131 ] 132 133 subsystem_name = "multimedia" 134 part_name = "multimedia_audio_framework" 135} 136 137ohos_shared_library("module-suspend-on-idle") { 138 sources = [ "$pulseaudio_dir/src/modules/module-suspend-on-idle.c" ] 139 cflags = [ "-DPA_MODULE_NAME=libmodule_suspend_on_idle_z_so" ] 140 141 ldflags = [ 142 "-Wl", 143 "--no-undefined", 144 ] 145 146 configs = [ ":common_config" ] 147 deps = [ ":common_deps" ] 148 149 subsystem_name = "multimedia" 150 part_name = "multimedia_audio_framework" 151} 152