• 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")
15
16config("resmgr_config") {
17  include_dirs = [
18    "include",
19    "//third_party/zlib/contrib/minizip",
20    "//base/global/resmgr_standard/interfaces/innerkits/include",
21    "//third_party/bounds_checking_function/include",
22    "//third_party/icu/icu4c/source",
23    "//third_party/icu/icu4c/source/common",
24    "//third_party/icu/icu4c/source/i18n",
25  ]
26}
27
28manager_sources = [
29  "src/hap_manager.cpp",
30  "src/hap_resource.cpp",
31  "src/locale_matcher.cpp",
32  "src/lock.cpp",
33  "src/res_config_impl.cpp",
34  "src/res_desc.cpp",
35  "src/res_locale.cpp",
36  "src/resource_manager_impl.cpp",
37  "src/utils/hap_parser.cpp",
38  "src/utils/string_utils.cpp",
39  "src/utils/utils.cpp",
40]
41
42config("resmgr_public_config") {
43  visibility = [ ":*" ]
44
45  include_dirs = [
46    "//base/global/resmgr_standard/interfaces/innerkits/include",
47    "//third_party/icu/icu4c/source/common",
48  ]
49}
50
51ohos_shared_library("global_resmgr") {
52  sources = manager_sources
53
54  defines = [ "CONFIG_HILOG" ]
55
56  configs = [ ":resmgr_config" ]
57
58  public_configs = [ ":resmgr_public_config" ]
59
60  deps = [
61    "//third_party/bounds_checking_function:libsec_static",
62    "//third_party/icu/icu4c:shared_icui18n",
63    "//third_party/icu/icu4c:shared_icuuc",
64    "//third_party/zlib:libz",
65  ]
66  external_deps = [
67    "bytrace_standard:bytrace_core",
68    "hiviewdfx_hilog_native:libhilog",
69  ]
70
71  subsystem_name = "global"
72  part_name = "resmgr_standard"
73}
74
75ohos_shared_library("global_resmgr_win") {
76  defines = [
77    "__WINNT__",
78    "__EXPORT_MGR__",
79    "__IDE_PREVIEW__",
80  ]
81  cflags = [
82    "-std=c++17",
83    "-Wno-ignored-attributes",
84  ]
85
86  sources = manager_sources
87
88  configs = [ ":resmgr_config" ]
89
90  public_configs = [ ":resmgr_public_config" ]
91
92  deps = [
93    "//third_party/icu/icu4c:static_icui18n(//build/toolchain/mingw:mingw_x86_64)",
94    "//third_party/icu/icu4c:static_icuuc(//build/toolchain/mingw:mingw_x86_64)",
95    "//third_party/zlib:libz(//build/toolchain/mingw:mingw_x86_64)",
96  ]
97
98  libs = [ "shlwapi" ]
99
100  subsystem_name = "global"
101  part_name = "resmgr_standard"
102}
103
104group("win_resmgr") {
105  if (host_os != "mac") {
106    deps = [ ":global_resmgr_win(//build/toolchain/mingw:mingw_x86_64)" ]
107  }
108}
109
110ohos_shared_library("global_resmgr_mac") {
111  defines = [ "__IDE_PREVIEW__" ]
112  cflags = [
113    "-std=c++17",
114    "-Wno-ignored-attributes",
115  ]
116
117  sources = manager_sources
118
119  configs = [ ":resmgr_config" ]
120
121  public_configs = [ ":resmgr_public_config" ]
122
123  if (host_os == "mac") {
124    deps = [
125      "//third_party/bounds_checking_function:libsec_static(//build/toolchain/mac:clang_x64)",
126      "//third_party/icu/icu4c:static_icui18n(//build/toolchain/mac:clang_x64)",
127      "//third_party/icu/icu4c:static_icuuc(//build/toolchain/mac:clang_x64)",
128      "//third_party/zlib:libz(//build/toolchain/mac:clang_x64)",
129    ]
130  }
131  subsystem_name = "global"
132  part_name = "resmgr_standard"
133}
134
135group("mac_resmgr") {
136  if (host_os == "mac") {
137    deps = [ ":global_resmgr_mac(//build/toolchain/mac:clang_x64)" ]
138  }
139}
140
141ohos_shared_library("librawfile") {
142  output_name = "rawfile"
143  sources = [ "src/raw_file_manager.cpp" ]
144
145  include_dirs = [
146    "//base/global/resmgr_standard/frameworks/resmgr/include",
147    "//base/global/resmgr_standard/interfaces/native/resource/include",
148    "//base/global/resmgr_standard/interfaces/innerkits/include",
149    "//base/global/resmgr_standard/interfaces/js/innerkits/core/include",
150    "//third_party/node/src",
151    "//third_party/icu/icu4c/source/i18n",
152  ]
153
154  cflags = [ "-Wno-error=inconsistent-missing-override" ]
155
156  deps = [
157    "//base/global/resmgr_standard/interfaces/native/resource:librawfile_ndk",
158  ]
159
160  public_deps = [
161    "//base/global/resmgr_standard/frameworks/resmgr:global_resmgr",
162    "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native",
163    "//foundation/ace/napi:ace_napi",
164  ]
165
166  external_deps = [
167    "ability_runtime:ability_manager",
168    "hiviewdfx_hilog_native:libhilog",
169  ]
170
171  version_script = get_label_info(
172                       "//base/global/resmgr_standard/interfaces/native/resource:librawfile_ndk",
173                       "target_gen_dir") + "/" + get_label_info(
174                       "//base/global/resmgr_standard/interfaces/native/resource:librawfile_ndk",
175                       "name") + version_script_suffix
176
177  subsystem_name = "global"
178  part_name = "resmgr_standard"
179}
180