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 ] 33 34 sources = [ 35 "src/ringtone_asset.cpp", 36 "src/ringtone_fetch_result.cpp", 37 "src/simcard_setting_asset.cpp", 38 "src/vibrate_asset.cpp", 39 ] 40 41 public_configs = [ ":ringtone_helper_public_config" ] 42 43 cflags = [ 44 "-Wall", 45 "-Werror", 46 "-Wno-unused-but-set-variable", 47 "-fdata-sections", 48 "-ffunction-sections", 49 "-Os", 50 ] 51 52 cflags_cc = [ 53 "-fvisibility-inlines-hidden", 54 "-Os", 55 ] 56 57 external_deps = [ 58 "ability_base:zuri", 59 "ability_runtime:abilitykit_native", 60 "app_file_service:sandbox_helper_native", 61 "c_utils:utils", 62 "common_event_service:cesfwk_innerkits", 63 "data_share:datashare_common", 64 "data_share:datashare_consumer", 65 "hilog:libhilog", 66 "hitrace:hitrace_meter", 67 "kv_store:distributeddata_inner", 68 "relational_store:native_rdb", 69 ] 70 71 if (!ringtone_link_opt) { 72 sanitize = { 73 cfi = true 74 cfi_cross_dso = true 75 debug = false 76 integer_overflow = true 77 ubsan = true 78 boundary_sanitize = true 79 } 80 } 81 82 subsystem_name = "multimedia" 83 part_name = "ringtone_library" 84} 85