• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023-2025 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("../../../../appexecfwk.gni")
16
17ohos_shared_library("bundle_res_common") {
18  branch_protector_ret = "pac_ret"
19
20  sanitize = {
21    boundary_sanitize = true
22    cfi = true
23    cfi_cross_dso = true
24    debug = false
25    integer_overflow = true
26    ubsan = true
27  }
28
29  include_dirs = [ "${kits_path}/js/common" ]
30  sources = [ "resource_helper.cpp" ]
31
32  cflags = [
33    "-Os",
34    "-fstack-protector-strong",
35  ]
36
37  cflags_cc = [
38    "-Os",
39    "-fstack-protector-strong",
40  ]
41
42  deps = [
43    "${base_path}:appexecfwk_base",
44    "${common_path}:libappexecfwk_common",
45    "${core_path}:appexecfwk_core",
46    "../common:bundle_napi_common",
47  ]
48
49  defines = [
50    "APP_LOG_TAG = \"BMS\"",
51    "LOG_DOMAIN = 0xD001120",
52  ]
53
54  external_deps = [
55    "c_utils:utils",
56    "hilog:libhilog",
57    "ipc:ipc_core",
58    "napi:ace_napi",
59    "runtime_core:ani",
60    "safwk:system_ability_fwk",
61    "samgr:samgr_proxy",
62  ]
63
64  subsystem_name = "bundlemanager"
65  part_name = "bundle_framework"
66}
67
68ohos_shared_library("bundleresourcemanager") {
69  branch_protector_ret = "pac_ret"
70
71  sanitize = {
72    boundary_sanitize = true
73    cfi = true
74    cfi_cross_dso = true
75    debug = false
76    integer_overflow = true
77    ubsan = true
78  }
79
80  include_dirs = [
81    "${inner_api_path}/bundlemgr_resource/include",
82    "${kits_path}/js/common",
83    "${kits_path}/js/resource_comm",
84  ]
85  defines = [
86    "APP_LOG_TAG = \"BMS\"",
87    "LOG_DOMAIN = 0xD001120",
88  ]
89  sources = [ "native_module.cpp" ]
90
91  deps = [
92    ":bundle_res_common",
93    "${base_path}:appexecfwk_base",
94    "${common_path}:libappexecfwk_common",
95    "${core_path}:appexecfwk_core",
96    "../common:bundle_napi_common",
97  ]
98
99  cflags = [
100    "-Os",
101    "-fstack-protector-strong",
102  ]
103
104  cflags_cc = [
105    "-Os",
106    "-fstack-protector-strong",
107  ]
108
109  external_deps = [
110    "c_utils:utils",
111    "hilog:libhilog",
112    "init:libbegetutil",
113    "ipc:ipc_core",
114    "napi:ace_napi",
115    "samgr:samgr_proxy",
116  ]
117
118  defines = []
119
120  if (bundle_framework_bundle_resource) {
121    defines += [ "BUNDLE_FRAMEWORK_BUNDLE_RESOURCE" ]
122    sources += [
123      "bundle_resource.cpp",
124      "bundle_resource_drawable_utils.cpp",
125    ]
126    if (bundle_framework_graphics) {
127      defines += [ "BUNDLE_FRAMEWORK_GRAPHICS" ]
128      external_deps += [
129        "ace_engine:drawable_descriptor",
130        "image_framework:image_native",
131        "resource_management:global_resmgr",
132      ]
133    }
134  } else {
135    sources += [ "bundle_resource_unsupported.cpp" ]
136  }
137
138  relative_install_dir = "module/bundle"
139  subsystem_name = "bundlemanager"
140  part_name = "bundle_framework"
141}
142