• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023 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/ets_utils/ets_utils_config.gni")
16
17config("console_public_config") {
18  visibility = [ ":*" ]
19  include_dirs = [
20    "${sys_module}/console",
21    js_concurrent_module_common,
22  ]
23}
24
25ohos_shared_library("console") {
26  branch_protector_ret = "pac_ret"
27  sanitize = {
28    cfi = true
29    cfi_cross_dso = true
30    debug = false
31  }
32
33  include_dirs = [
34    "../../js_concurrent_module/common",
35    "../console",
36  ]
37
38  public_configs = [ ":console_public_config" ]
39
40  sources = [
41    "../../js_concurrent_module/common/helper/napi_helper.cpp",
42    "console.cpp",
43  ]
44
45  deps = []
46
47  external_deps = [ "napi:ace_napi" ]
48
49  if (is_linux && current_toolchain == host_toolchain) {
50    deps += [ "$hilog_linux" ]
51    defines = [
52      "LINUX_PLATFORM",
53      "PREVIEW",
54    ]
55  } else if (is_mingw) {
56    external_deps += [ "hilog:libhilog" ]
57    defines = [
58      "WINDOWS_PLATFORM",
59      "NOGDI",
60    ]
61  } else if (is_mac && !is_arkui_x) {
62    external_deps += [ "hilog:libhilog" ]
63  } else if (is_standard_system) {
64    external_deps += [ "hilog:libhilog" ]
65  } else if (is_arkui_x) {
66    if (target_os == "ios") {
67      deps += [ "$hilog_ios" ]
68    } else if (target_os == "android") {
69      deps += [ "$hilog_android" ]
70    }
71  } else {
72    external_deps += [ "hilog:libhilog" ]
73  }
74  cflags = [ "-std=c++17" ]
75
76  subsystem_name = "commonlibrary"
77  innerapi_tags = [ "platformsdk_indirect" ]
78  part_name = "ets_utils"
79}
80
81ohos_source_set("console_static") {
82  branch_protector_ret = "pac_ret"
83  sanitize = {
84    cfi = true
85    cfi_cross_dso = true
86    debug = false
87  }
88  include_dirs = [
89    js_concurrent_module_common,
90    "../console",
91  ]
92
93  sources = [
94    "$js_concurrent_module_common/helper/napi_helper.cpp",
95    "console.cpp",
96  ]
97
98  deps = []
99
100  defines = []
101
102  if (is_arkui_x) {
103    include_dirs += [
104      "$plugins_root/hilog/include",
105      "$plugins_root/interfaces",
106    ]
107    deps += [ "$plugins_root/libs/napi:napi_${target_os}" ]
108    if (target_os == "android") {
109      defines += [ "ANDROID_PLATFORM" ]
110    }
111    if (target_os == "ios") {
112      defines += [ "IOS_PLATFORM" ]
113    }
114  } else {
115    deps += [ "$napi_root:ace_napi" ]
116  }
117
118  subsystem_name = "commonlibrary"
119  part_name = "ets_utils"
120}
121
122group("console_packages") {
123  deps = [ ":console" ]
124}
125