1049e185fSopenharmony_ci# Copyright (C) 2021 Huawei Device Co., Ltd.
2049e185fSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3049e185fSopenharmony_ci# you may not use this file except in compliance with the License.
4049e185fSopenharmony_ci# You may obtain a copy of the License at
5049e185fSopenharmony_ci#
6049e185fSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7049e185fSopenharmony_ci#
8049e185fSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9049e185fSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10049e185fSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11049e185fSopenharmony_ci# See the License for the specific language governing permissions and
12049e185fSopenharmony_ci# limitations under the License.
13049e185fSopenharmony_ci
14049e185fSopenharmony_ciimport("//build/ohos.gni")
15049e185fSopenharmony_ciimport("//foundation/multimedia/player_framework/config.gni")
16049e185fSopenharmony_ci
17049e185fSopenharmony_ciconfig("media_service_utils_public_config") {
18049e185fSopenharmony_ci  include_dirs = [ "include" ]
19049e185fSopenharmony_ci}
20049e185fSopenharmony_ci
21049e185fSopenharmony_ciohos_shared_library("media_service_utils") {
22049e185fSopenharmony_ci  branch_protector_ret = "pac_ret"
23049e185fSopenharmony_ci  install_enable = true
24049e185fSopenharmony_ci
25049e185fSopenharmony_ci  sanitize = {
26049e185fSopenharmony_ci    integer_overflow = true
27049e185fSopenharmony_ci    ubsan = true
28049e185fSopenharmony_ci    boundary_sanitize = true
29049e185fSopenharmony_ci    cfi = true
30049e185fSopenharmony_ci    cfi_cross_dso = true
31049e185fSopenharmony_ci    debug = false
32049e185fSopenharmony_ci  }
33049e185fSopenharmony_ci
34049e185fSopenharmony_ci  sources = [
35049e185fSopenharmony_ci    "avdatasrcmemory.cpp",
36049e185fSopenharmony_ci    "media_dfx.cpp",
37049e185fSopenharmony_ci    "media_permission.cpp",
38049e185fSopenharmony_ci    "media_utils.cpp",
39049e185fSopenharmony_ci    "player_xcollie.cpp",
40049e185fSopenharmony_ci    "task_queue.cpp",
41049e185fSopenharmony_ci    "time_format_utils.cpp",
42049e185fSopenharmony_ci    "uri_helper.cpp",
43049e185fSopenharmony_ci    "watchdog.cpp",
44049e185fSopenharmony_ci    "xml_parse.cpp",
45049e185fSopenharmony_ci  ]
46049e185fSopenharmony_ci
47049e185fSopenharmony_ci  include_dirs = [
48049e185fSopenharmony_ci    "//foundation/multimedia/player_framework/interfaces/inner_api/native",
49049e185fSopenharmony_ci    "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf",
50049e185fSopenharmony_ci  ]
51049e185fSopenharmony_ci
52049e185fSopenharmony_ci  defines = [ "MEDIA_OHOS" ]
53049e185fSopenharmony_ci  defines += player_framework_defines
54049e185fSopenharmony_ci  if (is_emulator) {
55049e185fSopenharmony_ci    defines += [ "EMULATOR_ENABLED" ]
56049e185fSopenharmony_ci  }
57049e185fSopenharmony_ci
58049e185fSopenharmony_ci  cflags = [
59049e185fSopenharmony_ci    "-std=c++17",
60049e185fSopenharmony_ci    "-fno-rtti",
61049e185fSopenharmony_ci    "-fno-exceptions",
62049e185fSopenharmony_ci    "-Wall",
63049e185fSopenharmony_ci    "-fno-common",
64049e185fSopenharmony_ci    "-fstack-protector-strong",
65049e185fSopenharmony_ci    "-Wshadow",
66049e185fSopenharmony_ci    "-FPIC",
67049e185fSopenharmony_ci    "-FS",
68049e185fSopenharmony_ci    "-O2",
69049e185fSopenharmony_ci    "-D_FORTIFY_SOURCE=2",
70049e185fSopenharmony_ci    "-fvisibility=hidden",
71049e185fSopenharmony_ci    "-Wformat=2",
72049e185fSopenharmony_ci    "-Wfloat-equal",
73049e185fSopenharmony_ci    "-Wdate-time",
74049e185fSopenharmony_ci    "-Werror",
75049e185fSopenharmony_ci    "-Wextra",
76049e185fSopenharmony_ci    "-Wimplicit-fallthrough",
77049e185fSopenharmony_ci    "-Wsign-compare",
78049e185fSopenharmony_ci    "-Wunused-parameter",
79049e185fSopenharmony_ci  ]
80049e185fSopenharmony_ci
81049e185fSopenharmony_ci  configs = [ ":media_service_utils_public_config" ]
82049e185fSopenharmony_ci
83049e185fSopenharmony_ci  external_deps = [
84049e185fSopenharmony_ci    "access_token:libaccesstoken_sdk",
85049e185fSopenharmony_ci    "access_token:libprivacy_sdk",
86049e185fSopenharmony_ci    "av_codec:av_codec_client",
87049e185fSopenharmony_ci    "bundle_framework:appexecfwk_base",
88049e185fSopenharmony_ci    "bundle_framework:appexecfwk_core",
89049e185fSopenharmony_ci    "c_utils:utils",
90049e185fSopenharmony_ci    "graphic_surface:surface",
91049e185fSopenharmony_ci    "hicollie:libhicollie",
92049e185fSopenharmony_ci    "hilog:libhilog",
93049e185fSopenharmony_ci    "hisysevent:libhisysevent",
94049e185fSopenharmony_ci    "hitrace:hitrace_meter",
95049e185fSopenharmony_ci    "hitrace:libhitracechain",
96049e185fSopenharmony_ci    "init:libbegetutil",
97049e185fSopenharmony_ci    "ipc:ipc_single",
98049e185fSopenharmony_ci    "libxml2:libxml2",
99049e185fSopenharmony_ci    "media_foundation:media_foundation",
100049e185fSopenharmony_ci    "qos_manager:qos",
101049e185fSopenharmony_ci    "samgr:samgr_proxy",
102049e185fSopenharmony_ci  ]
103049e185fSopenharmony_ci
104049e185fSopenharmony_ci  subsystem_name = "multimedia"
105049e185fSopenharmony_ci  innerapi_tags = [ "platformsdk" ]
106049e185fSopenharmony_ci  part_name = "player_framework"
107049e185fSopenharmony_ci}
108