# Copyright (C) 2021-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//commonlibrary/memory_utils/purgeable_mem_config.gni") import("//foundation/multimedia/media_library/media_library.gni") config("media_library_manager_config") { include_dirs = [ "${MEDIALIB_INTERFACES_PATH}/inner_api/media_library_helper/include" ] } ohos_shared_library("media_library_manager") { install_enable = true sources = [ "./media_library_manager.cpp", "./src/media_library_tab_old_photos_client.cpp", ] include_dirs = [ "./include", "${MEDIALIB_UTILS_PATH}/include", "${MEDIALIB_INNERKITS_PATH}/media_library_helper/include", "${MEDIALIB_INTERFACES_PATH}/kits/js/include", "${MEDIALIB_SERVICES_PATH}/media_thumbnail/include", "${MEDIALIB_INNERKITS_PATH}/medialibrary_data_extension/include", ] public_configs = [ ":media_library_manager_config" ] deps = [ "${MEDIALIB_INNERKITS_PATH}/media_library_helper:media_library" ] external_deps = [ "ability_base:want", "ability_base:zuri", "ability_runtime:ability_manager", "ability_runtime:abilitykit_native", "access_token:libaccesstoken_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "app_file_service:fileuri_native", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_innerkits", "data_share:datashare_common", "data_share:datashare_consumer", "hilog:libhilog", "hitrace:hitrace_meter", "image_framework:image_native", "kv_store:distributeddata_inner", "relational_store:rdb_data_share_adapter", "samgr:samgr_proxy", ] ldflags = [ "-Wl,--gc-sections" ] cflags = [ "-fdata-sections", "-ffunction-sections", "-Os", ] cflags_cc = [ "-Os" ] if (!media_library_link_opt) { sanitize = { cfi = true cfi_cross_dso = true debug = false integer_overflow = true ubsan = true boundary_sanitize = true stack_protector_ret = true } } defines = [] defines += [ "MEDIALIBRARY_COMPATIBILITY=1" ] if (memory_utils_purgeable_ashmem_enable && defined(global_parts_info) && defined(global_parts_info.resourceschedule_memmgr_override)) { defines += [ "IMAGE_PURGEABLE_PIXELMAP" ] external_deps += [ "memmgr_override:libpurgeablemem_plugin", "memmgr_override:purgeable_pixelmap_builder", ] } part_name = "media_library" subsystem_name = "multimedia" }