# Copyright (C) 2021-2022 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("//foundation/multimedia/media_library/media_library.gni") group("media_library_packages") { deps = [ ":media_library" ] } config("media_library_config") { visibility = [ ":*" ] } ohos_shared_library("media_library") { install_enable = true include_dirs = [ "${MEDIALIB_INNERKITS_PATH}/media_library_helper/include", "${MEDIALIB_INTERFACES_PATH}/inner_api/media_library_helper/include", "${MEDIALIB_UTILS_PATH}/include", "${MEDIALIB_UTILS_PATH}/include", "//third_party/json/include", ] sources = [ "src/acl.cpp", "src/album_asset.cpp", "src/base_column.cpp", "src/dir_asset.cpp", "src/fetch_result.cpp", "src/file_asset.cpp", "src/form_map.cpp", "src/media_asset_edit_data.cpp", "src/media_column.cpp", "src/media_file_uri.cpp", "src/media_file_utils.cpp", "src/media_volume.cpp", "src/medialibrary_helper_container.cpp", "src/medialibrary_kvstore.cpp", "src/medialibrary_kvstore_manager.cpp", "src/mimetype_utils.cpp", "src/native_album_asset.cpp", "src/photo_album.cpp", "src/photo_album_column.cpp", "src/photo_map_column.cpp", "src/smart_album_asset.cpp", ] configs = [ ":media_library_config" ] cflags = [ "-Wall", "-Werror", "-Wno-unused-but-set-variable", "-fdata-sections", "-ffunction-sections", "-Os", ] cflags_cc = [ "-Os" ] external_deps = [ "ability_base:zuri", "ability_runtime:abilitykit_native", "app_file_service:sandbox_helper_native", "c_utils:utils", "common_event_service:cesfwk_innerkits", "data_share:datashare_common", "data_share:datashare_consumer", "hilog:libhilog", "hitrace:hitrace_meter", "kv_store:distributeddata_inner", "relational_store:native_rdb", ] defines = [] defines += [ "MEDIALIBRARY_COMPATIBILITY=1" ] if (!link_opt) { sanitize = { cfi = true cfi_cross_dso = true debug = false integer_overflow = true ubsan = true boundary_sanitize = true stack_protector_ret = true } } innerapi_tags = [ "platformsdk" ] part_name = "media_library" subsystem_name = "multimedia" }