1# Copyright (C) 2021-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/media_library/media_library.gni") 16 17config("media_library_handler_config") { 18 include_dirs = 19 [ "${MEDIALIB_INTERFACES_PATH}/inner_api/media_library_helper/include" ] 20} 21 22ohos_shared_library("media_library_handler") { 23 install_enable = true 24 25 sources = [ "./media_library_handler.cpp" ] 26 27 include_dirs = [ 28 "./include", 29 "${MEDIALIB_UTILS_PATH}/include", 30 "${MEDIALIB_INNERKITS_PATH}/media_library_helper/include", 31 "${MEDIALIB_INTERFACES_PATH}/kits/js/include", 32 "${MEDIALIB_SERVICES_PATH}/media_thumbnail/include", 33 "${MEDIALIB_INNERKITS_PATH}/medialibrary_data_extension/include", 34 ] 35 36 public_configs = [ ":media_library_handler_config" ] 37 38 external_deps = [ 39 "access_token:libaccesstoken_sdk", 40 "access_token:libprivacy_sdk", 41 "access_token:libtokenid_sdk", 42 "c_utils:utils", 43 "data_share:datashare_common", 44 "data_share:datashare_consumer", 45 "hilog:libhilog", 46 "hitrace:hitrace_meter", 47 "kv_store:distributeddata_inner", 48 "os_account:os_account_innerkits", 49 "relational_store:native_rdb", 50 "samgr:samgr_proxy", 51 ] 52 53 ldflags = [ "-Wl,--gc-sections" ] 54 55 cflags = [ 56 "-fdata-sections", 57 "-ffunction-sections", 58 "-Os", 59 ] 60 61 cflags_cc = [ "-Os" ] 62 63 if (!media_library_link_opt) { 64 sanitize = { 65 cfi = true 66 cfi_cross_dso = true 67 debug = false 68 integer_overflow = true 69 ubsan = true 70 boundary_sanitize = true 71 stack_protector_ret = true 72 } 73 } 74 75 part_name = "media_library" 76 subsystem_name = "multimedia" 77} 78