1# Copyright (c) 2021 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.
13import("//base/update/updater/updater_default_cfg.gni")
14import("//build/ohos.gni")
15
16updater_path = rebase_path("${updater_absolutely_path}", ".")
17
18config("log_config") {
19  if (is_linux || is_mingw || is_mac) {
20    cflags_cc = [ "-std=c++17" ]
21    defines = [ "DIFF_PATCH_SDK" ]
22  }
23  visibility = [ ":*" ]
24  include_dirs = [
25    "${updater_path}/services/include",
26    "${updater_path}/utils/include",
27    "${updater_path}/services/include/log",
28  ]
29}
30
31ohos_shared_library("libupdaterlog_shared") {
32  sources = [
33    "dump.cpp",
34    "log.cpp",
35  ]
36
37  include_dirs = [
38    "${updater_path}/services/include",
39    "${updater_path}/utils/include",
40  ]
41
42  public_configs = [ ":log_config" ]
43
44  external_deps = [ "bounds_checking_function:libsec_static" ]
45
46  if (!is_linux && !is_mingw && !is_mac) {
47    external_deps += [ "hilog:libhilog_base" ]
48  }
49
50  deps = []
51
52  innerapi_tags = [
53    "platformsdk",
54    "sasdk",
55  ]
56
57  install_enable = true
58  install_images = [
59    "system",
60    "updater",
61  ]
62  subsystem_name = "updater"
63  part_name = "updater"
64}
65
66ohos_static_library("libupdaterlog") {
67  sources = [
68    "dump.cpp",
69    "log.cpp",
70  ]
71
72  include_dirs = [
73    "${updater_path}/services/include",
74    "${updater_path}/utils/include",
75  ]
76
77  public_configs = [ ":log_config" ]
78
79  external_deps = [ "bounds_checking_function:libsec_static" ]
80
81  if (!is_linux && !is_mingw && !is_mac) {
82    external_deps += [ "hilog:libhilog_base" ]
83  }
84
85  deps = []
86  subsystem_name = "updater"
87  part_name = "updater"
88}
89