1# Copyright (C) 2024 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")
15import("//foundation/multimedia/ringtone_library/ringtone_library.gni")
16
17config("ringtone_helper_public_config") {
18  visibility = [ ":*" ]
19}
20
21ohos_shared_library("ringtone_data_helper") {
22  branch_protector_ret = "pac_ret"
23  install_enable = true
24
25  include_dirs = [
26    "${RINGTONE_SCANNER_PATH}/include",
27    "${RINGTONE_RESTORE_PATH}/include",
28    "${RINGTONE_EXTENSION_PATH}/include",
29    "${RINGTONE_DFX_PATH}/include",
30    "${RINGTONE_SERVICES_PATH}/utils/include",
31    "${RINGTONE_INTERFACES_PATH}/inner_api/native",
32    "${RINGTONE_HELPER_PATH}/include",
33  ]
34
35  sources = [
36    "src/ringtone_asset.cpp",
37    "src/ringtone_fetch_result.cpp",
38    "src/simcard_setting_asset.cpp",
39    "src/vibrate_asset.cpp",
40  ]
41
42  public_configs = [ ":ringtone_helper_public_config" ]
43
44  cflags = [
45    "-Wall",
46    "-Werror",
47    "-Wno-unused-but-set-variable",
48    "-fdata-sections",
49    "-ffunction-sections",
50    "-Os",
51  ]
52
53  cflags_cc = [ "-Os" ]
54
55  external_deps = [
56    "ability_base:zuri",
57    "ability_runtime:abilitykit_native",
58    "app_file_service:sandbox_helper_native",
59    "c_utils:utils",
60    "common_event_service:cesfwk_innerkits",
61    "data_share:datashare_common",
62    "data_share:datashare_consumer",
63    "hilog:libhilog",
64    "hitrace:hitrace_meter",
65    "kv_store:distributeddata_inner",
66    "relational_store:native_rdb",
67  ]
68
69  if (!ringtone_link_opt) {
70    sanitize = {
71      cfi = true
72      cfi_cross_dso = true
73      debug = false
74      integer_overflow = true
75      ubsan = true
76      boundary_sanitize = true
77    }
78  }
79
80  subsystem_name = "multimedia"
81  part_name = "ringtone_library"
82}
83