# Copyright (C) 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("//foundation/multimedia/media_library/media_library.gni") config("media_capi_config") { include_dirs = [ "${MEDIALIB_INTERFACES_PATH}/inner_api/media_library_helper/include", "${MEDIALIB_INTERFACES_PATH}/kits/c", "${MEDIALIB_ROOT_PATH}/frameworks/native/c_api/common", ] cflags = [ "-Wall", "-Werror", "-Wno-unused-but-set-variable", "-fdata-sections", "-ffunction-sections", "-Os", ] cflags_cc = [ "-std=c++17", "-fno-rtti", ] } config("media_capi_public_config") { include_dirs = [ "${MEDIALIB_INTERFACES_PATH}/kits/c", "${MEDIALIB_ROOT_PATH}/frameworks/native/capi/common", ] } ohos_shared_library("native_media_asset_manager") { install_enable = true 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 } } sources = [ "${MEDIALIB_NATIVE_PATH}/c_api/media_access_helper_capi/media_access_helper_capi.cpp", "${MEDIALIB_NATIVE_PATH}/c_api/media_asset_capi/media_asset_capi.cpp", "${MEDIALIB_NATIVE_PATH}/c_api/media_asset_change_request_capi/media_asset_change_request_capi.cpp", "${MEDIALIB_NATIVE_PATH}/c_api/moving_photo_capi/moving_photo_capi.cpp", "${MEDIALIB_ROOT_PATH}/frameworks/native/c_api/media_asset_manger_capi/media_asset_manager_capi.cpp", ] configs = [ ":media_capi_config" ] deps = [ "${MEDIALIB_INNERKITS_PATH}/media_library_helper:media_library", "${MEDIALIB_NATIVE_PATH}/media_library_asset_manager:media_library_asset_manager", ] public_configs = [ ":media_capi_public_config" ] external_deps = [ "c_utils:utils", "data_share:datashare_common", "data_share:datashare_consumer", "hilog:libhilog", "image_framework:ohimage", "napi:ace_napi", "resource_management:librawfile", ] output_name = "media_asset_manager" output_extension = "so" innerapi_tags = [ "ndk" ] subsystem_name = "multimedia" part_name = "media_library" }