1# Copyright (C) 2021-2022 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 17group("media_library_packages") { 18 deps = [ ":media_library" ] 19} 20 21config("media_library_config") { 22 visibility = [ ":*" ] 23} 24 25ohos_shared_library("media_library") { 26 install_enable = true 27 28 include_dirs = [ 29 "${MEDIALIB_INNERKITS_PATH}/media_library_helper/include", 30 "${MEDIALIB_INTERFACES_PATH}/inner_api/media_library_helper/include", 31 "${MEDIALIB_UTILS_PATH}/include", 32 "${MEDIALIB_UTILS_PATH}/include", 33 "//third_party/json/include", 34 ] 35 36 sources = [ 37 "src/acl.cpp", 38 "src/album_asset.cpp", 39 "src/base_column.cpp", 40 "src/dir_asset.cpp", 41 "src/fetch_result.cpp", 42 "src/file_asset.cpp", 43 "src/form_map.cpp", 44 "src/media_asset_edit_data.cpp", 45 "src/media_column.cpp", 46 "src/media_file_uri.cpp", 47 "src/media_file_utils.cpp", 48 "src/media_volume.cpp", 49 "src/medialibrary_helper_container.cpp", 50 "src/medialibrary_kvstore.cpp", 51 "src/medialibrary_kvstore_manager.cpp", 52 "src/mimetype_utils.cpp", 53 "src/native_album_asset.cpp", 54 "src/photo_album.cpp", 55 "src/photo_album_column.cpp", 56 "src/photo_map_column.cpp", 57 "src/smart_album_asset.cpp", 58 ] 59 60 configs = [ ":media_library_config" ] 61 cflags = [ 62 "-Wall", 63 "-Werror", 64 "-Wno-unused-but-set-variable", 65 "-fdata-sections", 66 "-ffunction-sections", 67 "-Os", 68 ] 69 70 cflags_cc = [ "-Os" ] 71 72 external_deps = [ 73 "ability_base:zuri", 74 "ability_runtime:abilitykit_native", 75 "app_file_service:sandbox_helper_native", 76 "c_utils:utils", 77 "common_event_service:cesfwk_innerkits", 78 "data_share:datashare_common", 79 "data_share:datashare_consumer", 80 "hilog:libhilog", 81 "hitrace:hitrace_meter", 82 "kv_store:distributeddata_inner", 83 "relational_store:native_rdb", 84 ] 85 86 defines = [] 87 defines += [ "MEDIALIBRARY_COMPATIBILITY=1" ] 88 89 if (!link_opt) { 90 sanitize = { 91 cfi = true 92 cfi_cross_dso = true 93 debug = false 94 integer_overflow = true 95 ubsan = true 96 boundary_sanitize = true 97 stack_protector_ret = true 98 } 99 } 100 101 innerapi_tags = [ "platformsdk" ] 102 part_name = "media_library" 103 subsystem_name = "multimedia" 104} 105