• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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("//commonlibrary/memory_utils/purgeable_mem_config.gni")
16import("//foundation/multimedia/media_library/media_library.gni")
17
18ohos_shared_library("media_library_manager") {
19  install_enable = true
20
21  sources = [ "./media_library_manager.cpp" ]
22
23  include_dirs = [
24    "${MEDIALIB_UTILS_PATH}/include",
25    "${MEDIALIB_INNERKITS_PATH}/media_library_helper/include",
26    "${MEDIALIB_INTERFACES_PATH}/inner_api/media_library_helper/include",
27    "${MEDIALIB_SERVICES_PATH}/media_thumbnail/include",
28  ]
29
30  deps = [ "${MEDIALIB_INNERKITS_PATH}/media_library_helper:media_library" ]
31
32  external_deps = [
33    "ability_base:want",
34    "ability_base:zuri",
35    "ability_runtime:ability_manager",
36    "ability_runtime:abilitykit_native",
37    "access_token:libtokenid_sdk",
38    "bundle_framework:appexecfwk_base",
39    "bundle_framework:appexecfwk_core",
40    "c_utils:utils",
41    "common_event_service:cesfwk_innerkits",
42    "data_share:datashare_common",
43    "data_share:datashare_consumer",
44    "hilog:libhilog",
45    "hitrace:hitrace_meter",
46    "image_framework:image_native",
47    "kv_store:distributeddata_inner",
48  ]
49
50  ldflags = [ "-Wl,--gc-sections" ]
51
52  cflags = [
53    "-fdata-sections",
54    "-ffunction-sections",
55    "-Os",
56  ]
57
58  cflags_cc = [ "-Os" ]
59
60  if (!link_opt) {
61    sanitize = {
62      cfi = true
63      cfi_cross_dso = true
64      debug = false
65      integer_overflow = true
66      ubsan = true
67      boundary_sanitize = true
68      stack_protector_ret = true
69    }
70  }
71
72  defines = []
73  defines += [ "MEDIALIBRARY_COMPATIBILITY=1" ]
74
75  if (purgeable_ashmem_enable && defined(global_parts_info) &&
76      defined(global_parts_info.resourceschedule_memmgr_plugin)) {
77    defines += [ "IMAGE_PURGEABLE_PIXELMAP" ]
78    external_deps += [
79      "memmgr_plugin:libpurgeablemem_plugin",
80      "memmgr_plugin:purgeable_pixelmap_builder",
81    ]
82  }
83
84  part_name = "media_library"
85  subsystem_name = "multimedia"
86}
87