# Copyright (c) 2021-2022 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") config("resmgr_config") { include_dirs = [ "include", "//third_party/zlib/contrib/minizip", "//base/global/resmgr_standard/interfaces/innerkits/include", "//third_party/bounds_checking_function/include", "//third_party/icu/icu4c/source", "//third_party/icu/icu4c/source/common", "//third_party/icu/icu4c/source/i18n", ] } manager_sources = [ "src/hap_manager.cpp", "src/hap_resource.cpp", "src/locale_matcher.cpp", "src/lock.cpp", "src/res_config_impl.cpp", "src/res_desc.cpp", "src/res_locale.cpp", "src/resource_manager_impl.cpp", "src/utils/hap_parser.cpp", "src/utils/string_utils.cpp", "src/utils/utils.cpp", ] config("resmgr_public_config") { visibility = [ ":*" ] include_dirs = [ "//base/global/resmgr_standard/interfaces/innerkits/include", "//third_party/icu/icu4c/source/common", ] } ohos_shared_library("global_resmgr") { sources = manager_sources defines = [ "CONFIG_HILOG" ] configs = [ ":resmgr_config" ] public_configs = [ ":resmgr_public_config" ] deps = [ "//third_party/bounds_checking_function:libsec_static", "//third_party/icu/icu4c:shared_icui18n", "//third_party/icu/icu4c:shared_icuuc", "//third_party/zlib:libz", ] external_deps = [ "bytrace_standard:bytrace_core", "hiviewdfx_hilog_native:libhilog", ] subsystem_name = "global" part_name = "resmgr_standard" } ohos_shared_library("global_resmgr_win") { defines = [ "__WINNT__", "__EXPORT_MGR__", "__IDE_PREVIEW__", ] cflags = [ "-std=c++17", "-Wno-ignored-attributes", ] sources = manager_sources configs = [ ":resmgr_config" ] public_configs = [ ":resmgr_public_config" ] deps = [ "//third_party/icu/icu4c:static_icui18n(//build/toolchain/mingw:mingw_x86_64)", "//third_party/icu/icu4c:static_icuuc(//build/toolchain/mingw:mingw_x86_64)", "//third_party/zlib:libz(//build/toolchain/mingw:mingw_x86_64)", ] libs = [ "shlwapi" ] subsystem_name = "global" part_name = "resmgr_standard" } group("win_resmgr") { if (host_os != "mac") { deps = [ ":global_resmgr_win(//build/toolchain/mingw:mingw_x86_64)" ] } } ohos_shared_library("global_resmgr_mac") { defines = [ "__IDE_PREVIEW__" ] cflags = [ "-std=c++17", "-Wno-ignored-attributes", ] sources = manager_sources configs = [ ":resmgr_config" ] public_configs = [ ":resmgr_public_config" ] if (host_os == "mac") { deps = [ "//third_party/bounds_checking_function:libsec_static(//build/toolchain/mac:clang_x64)", "//third_party/icu/icu4c:static_icui18n(//build/toolchain/mac:clang_x64)", "//third_party/icu/icu4c:static_icuuc(//build/toolchain/mac:clang_x64)", "//third_party/zlib:libz(//build/toolchain/mac:clang_x64)", ] } subsystem_name = "global" part_name = "resmgr_standard" } group("mac_resmgr") { if (host_os == "mac") { deps = [ ":global_resmgr_mac(//build/toolchain/mac:clang_x64)" ] } } ohos_shared_library("librawfile") { output_name = "rawfile" sources = [ "src/raw_file_manager.cpp" ] include_dirs = [ "//base/global/resmgr_standard/frameworks/resmgr/include", "//base/global/resmgr_standard/interfaces/native/resource/include", "//base/global/resmgr_standard/interfaces/innerkits/include", "//base/global/resmgr_standard/interfaces/js/innerkits/core/include", "//third_party/node/src", "//third_party/icu/icu4c/source/i18n", ] cflags = [ "-Wno-error=inconsistent-missing-override" ] deps = [ "//base/global/resmgr_standard/interfaces/native/resource:librawfile_ndk", ] public_deps = [ "//base/global/resmgr_standard/frameworks/resmgr:global_resmgr", "//foundation/aafwk/standard/frameworks/kits/ability/native:abilitykit_native", "//foundation/ace/napi:ace_napi", ] external_deps = [ "ability_runtime:ability_manager", "hiviewdfx_hilog_native:libhilog", ] version_script = get_label_info( "//base/global/resmgr_standard/interfaces/native/resource:librawfile_ndk", "target_gen_dir") + "/" + get_label_info( "//base/global/resmgr_standard/interfaces/native/resource:librawfile_ndk", "name") + version_script_suffix subsystem_name = "global" part_name = "resmgr_standard" }