1# Copyright (C) 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_capi_config") { 18 include_dirs = [ 19 "${MEDIALIB_INTERFACES_PATH}/inner_api/media_library_helper/include", 20 "${MEDIALIB_INTERFACES_PATH}/kits/c", 21 "${MEDIALIB_ROOT_PATH}/frameworks/native/c_api/common", 22 ] 23 24 cflags = [ 25 "-Wall", 26 "-Werror", 27 "-Wno-unused-but-set-variable", 28 "-fdata-sections", 29 "-ffunction-sections", 30 "-Os", 31 ] 32 33 cflags_cc = [ 34 "-std=c++17", 35 "-fno-rtti", 36 ] 37} 38 39config("media_capi_public_config") { 40 include_dirs = [ 41 "${MEDIALIB_INTERFACES_PATH}/kits/c", 42 "${MEDIALIB_ROOT_PATH}/frameworks/native/capi/common", 43 ] 44} 45 46ohos_shared_library("native_media_asset_manager") { 47 install_enable = true 48 49 if (!media_library_link_opt) { 50 sanitize = { 51 cfi = true 52 cfi_cross_dso = true 53 debug = false 54 integer_overflow = true 55 ubsan = true 56 boundary_sanitize = true 57 stack_protector_ret = true 58 } 59 } 60 61 sources = [ 62 "${MEDIALIB_NATIVE_PATH}/c_api/media_access_helper_capi/media_access_helper_capi.cpp", 63 "${MEDIALIB_NATIVE_PATH}/c_api/media_asset_capi/media_asset_capi.cpp", 64 "${MEDIALIB_NATIVE_PATH}/c_api/media_asset_change_request_capi/media_asset_change_request_capi.cpp", 65 "${MEDIALIB_NATIVE_PATH}/c_api/moving_photo_capi/moving_photo_capi.cpp", 66 "${MEDIALIB_ROOT_PATH}/frameworks/native/c_api/media_asset_manger_capi/media_asset_manager_capi.cpp", 67 ] 68 69 configs = [ ":media_capi_config" ] 70 71 deps = [ 72 "${MEDIALIB_INNERKITS_PATH}/media_library_helper:media_library", 73 "${MEDIALIB_NATIVE_PATH}/media_library_asset_manager:media_library_asset_manager", 74 ] 75 76 public_configs = [ ":media_capi_public_config" ] 77 78 external_deps = [ 79 "c_utils:utils", 80 "data_share:datashare_common", 81 "data_share:datashare_consumer", 82 "hilog:libhilog", 83 "image_framework:ohimage", 84 "napi:ace_napi", 85 "resource_management:librawfile", 86 ] 87 output_name = "media_asset_manager" 88 output_extension = "so" 89 innerapi_tags = [ "ndk" ] 90 subsystem_name = "multimedia" 91 part_name = "media_library" 92} 93