• 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
17ohos_shared_library("console") {
18  include_dirs = [
19    "../../js_concurrent_module/common",
20    "../console",
21  ]
22
23  sources = [
24    "../../js_concurrent_module/common/helper/napi_helper.cpp",
25    "console.cpp",
26  ]
27
28  deps = []
29
30  external_deps = [ "napi:ace_napi" ]
31
32  if (is_linux && current_toolchain == host_toolchain) {
33    deps += [ "$hilog_linux" ]
34    defines = [
35      "LINUX_PLATFORM",
36      "PREVIEW",
37    ]
38  } else if (is_mingw) {
39    external_deps += [ "hilog:libhilog" ]
40    defines = [
41      "WINDOWS_PLATFORM",
42      "NOGDI",
43    ]
44  } else if (is_mac && !is_arkui_x) {
45    external_deps += [ "hilog:libhilog" ]
46  } else if (is_standard_system) {
47    external_deps += [ "hilog:libhilog" ]
48  } else if (is_arkui_x) {
49    if (target_os == "ios") {
50      deps += [ "$hilog_ios" ]
51    } else if (target_os == "android") {
52      deps += [ "$hilog_android" ]
53    }
54  } else {
55    external_deps += [ "hilog:libhilog" ]
56  }
57  cflags = [ "-std=c++17" ]
58
59  subsystem_name = "commonlibrary"
60  innerapi_tags = [ "platformsdk_indirect" ]
61  part_name = "ets_utils"
62}
63
64ohos_source_set("console_static") {
65  include_dirs = [
66    js_concurrent_module_common,
67    "../console",
68  ]
69
70  sources = [
71    "$js_concurrent_module_common/helper/napi_helper.cpp",
72    "console.cpp",
73  ]
74
75  deps = []
76
77  defines = []
78
79  if (is_arkui_x) {
80    include_dirs += [
81      "$plugins_root/hilog/include",
82      "$plugins_root/interfaces",
83    ]
84    deps += [ "$plugins_root/libs/napi:napi_${target_os}" ]
85    if (target_os == "android") {
86      defines += [ "ANDROID_PLATFORM" ]
87    }
88    if (target_os == "ios") {
89      defines += [ "IOS_PLATFORM" ]
90    }
91  } else {
92    deps += [ "$napi_root:ace_napi" ]
93  }
94
95  subsystem_name = "commonlibrary"
96  part_name = "ets_utils"
97}
98
99group("console_packages") {
100  deps = [ ":console" ]
101}
102