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
16config("pulsecore_config") {
17  visibility = [ ":*" ]
18
19  include_dirs = [
20    "../../../include",
21    "../../../",
22    "../../../src",
23    "../../include",
24    "../../src",
25  ]
26
27  cflags = [
28    "-Wall",
29    "-Werror",
30    "-Wno-implicit-function-declaration",
31    "-Wno-unused-function",
32    "-Wno-uninitialized",
33    "-DHAVE_CONFIG_H",
34    "-D_GNU_SOURCE",
35    "-D__INCLUDED_FROM_PULSE_AUDIO",
36  ]
37}
38
39ohos_source_set("pulsecore_sources") {
40  sources = [
41    "../../../src/pulsecore/asyncmsgq.c",
42    "../../../src/pulsecore/asyncq.c",
43    "../../../src/pulsecore/auth-cookie.c",
44    "../../../src/pulsecore/card.c",
45    "../../../src/pulsecore/cli-command.c",
46    "../../../src/pulsecore/cli-text.c",
47    "../../../src/pulsecore/client.c",
48    "../../../src/pulsecore/core-scache.c",
49    "../../../src/pulsecore/core-subscribe.c",
50    "../../../src/pulsecore/core.c",
51    "../../../src/pulsecore/cpu-arm.c",
52    "../../../src/pulsecore/database-simple.c",
53    "../../../src/pulsecore/database.c",
54    "../../../src/pulsecore/device-port.c",
55    "../../../src/pulsecore/downmix.c",
56    "../../../src/pulsecore/ffmpeg/resample2.c",
57    "../../../src/pulsecore/filter/biquad.c",
58    "../../../src/pulsecore/filter/crossover.c",
59    "../../../src/pulsecore/filter/lfe-filter.c",
60    "../../../src/pulsecore/hook-list.c",
61    "../../../src/pulsecore/ltdl-helper.c",
62    "../../../src/pulsecore/message-handler.c",
63    "../../../src/pulsecore/mix.c",
64    "../../../src/pulsecore/modargs.c",
65    "../../../src/pulsecore/modinfo.c",
66    "../../../src/pulsecore/module.c",
67    "../../../src/pulsecore/msgobject.c",
68    "../../../src/pulsecore/namereg.c",
69    "../../../src/pulsecore/object.c",
70    "../../../src/pulsecore/play-memblockq.c",
71    "../../../src/pulsecore/play-memchunk.c",
72    "../../../src/pulsecore/remap.c",
73    "../../../src/pulsecore/resampler.c",
74    "../../../src/pulsecore/resampler/ffmpeg.c",
75    "../../../src/pulsecore/resampler/peaks.c",
76    "../../../src/pulsecore/resampler/trivial.c",
77    "../../../src/pulsecore/rtpoll.c",
78    "../../../src/pulsecore/sconv-s16be.c",
79    "../../../src/pulsecore/sconv-s16le.c",
80    "../../../src/pulsecore/sconv.c",
81    "../../../src/pulsecore/shared.c",
82    "../../../src/pulsecore/sink-input.c",
83    "../../../src/pulsecore/sink.c",
84    "../../../src/pulsecore/sioman.c",
85    "../../../src/pulsecore/source-output.c",
86    "../../../src/pulsecore/source.c",
87    "../../../src/pulsecore/start-child.c",
88    "../../../src/pulsecore/stream-util.c",
89    "../../../src/pulsecore/svolume_arm.c",
90    "../../../src/pulsecore/svolume_c.c",
91    "../../../src/pulsecore/svolume_mmx.c",
92    "../../../src/pulsecore/svolume_sse.c",
93    "../../../src/pulsecore/thread-mq.c",
94    "../../src/pulsecore/ltdl_stub.c",
95  ]
96
97  configs = [ ":pulsecore_config" ]
98
99  external_deps = [ "hilog:libhilog" ]
100
101  defines = []
102  if (defined(global_parts_info) &&
103      defined(global_parts_info.hiviewdfx_hitrace)) {
104    defines += [ "FEATURE_HITRACE_METER" ]
105    external_deps += [ "hitrace:hitrace_meter" ]
106  }
107
108  subsystem_name = "thirdparty"
109  part_name = "pulseaudio"
110}
111
112config("export_pulsecore_include") {
113  include_dirs = [
114    "../../../include",
115    "../../../src",
116    "../../include",
117    "../../src",
118  ]
119}
120
121ohos_shared_library("pulsecore") {
122  sanitize = {
123    integer_overflow = true
124  }
125
126  deps = [
127    ":pulsecore_sources",
128    "../../src:pulsecommon",
129  ]
130
131  public_configs = [ ":export_pulsecore_include" ]
132
133  external_deps = [ "hilog:libhilog" ]
134
135  defines = []
136  if (defined(global_parts_info) &&
137      defined(global_parts_info.hiviewdfx_hitrace)) {
138    defines += [ "FEATURE_HITRACE_METER" ]
139    external_deps += [ "hitrace:hitrace_meter" ]
140  }
141
142  subsystem_name = "thirdparty"
143  innerapi_tags = [
144    "chipsetsdk_indirect",
145    "platformsdk_indirect",
146  ]
147  part_name = "pulseaudio"
148}
149
150config("modules_internal_lib_config") {
151  visibility = [ ":*" ]
152
153  include_dirs = [
154    "../../include",
155    "../../../include",
156    "../../../src",
157    "../../../",
158    "../../src",
159  ]
160
161  cflags = [
162    "-Wall",
163    "-Werror",
164    "-Wno-unused-function",
165    "-DHAVE_CONFIG_H",
166    "-D_GNU_SOURCE",
167    "-D__INCLUDED_FROM_PULSE_AUDIO",
168  ]
169}
170
171ohos_shared_library("cli") {
172  sources = [ "../../../src/pulsecore/cli.c" ]
173
174  configs = [ ":modules_internal_lib_config" ]
175
176  deps = [
177    "../../src:pulsecommon",
178    "../../src/pulsecore:pulsecore",
179  ]
180  external_deps = [ "hilog:libhilog" ]
181  subsystem_name = "thirdparty"
182  part_name = "pulseaudio"
183}
184
185ohos_shared_library("protocol-cli") {
186  sources = [ "../../../src/pulsecore/protocol-cli.c" ]
187
188  configs = [ ":modules_internal_lib_config" ]
189
190  deps = [
191    "../../src:pulsecommon",
192    "../../src/pulsecore:cli",
193    "../../src/pulsecore:pulsecore",
194  ]
195  external_deps = [ "hilog:libhilog" ]
196  subsystem_name = "thirdparty"
197  part_name = "pulseaudio"
198}
199
200ohos_shared_library("protocol-native") {
201  sources = [ "../../../src/pulsecore/protocol-native.c" ]
202
203  configs = [ ":modules_internal_lib_config" ]
204
205  deps = [
206    "../../src:pulsecommon",
207    "../../src/pulsecore:pulsecore",
208  ]
209
210  external_deps = [ "hilog:libhilog" ]
211
212  defines = []
213  if (defined(global_parts_info) &&
214      defined(global_parts_info.hiviewdfx_hitrace)) {
215    defines += [ "FEATURE_HITRACE_METER" ]
216    external_deps += [ "hitrace:hitrace_meter" ]
217  }
218
219  subsystem_name = "thirdparty"
220  part_name = "pulseaudio"
221}
222