• 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("timer") {
18  include_dirs = [
19    "../../js_concurrent_module/common",
20    "../timer",
21  ]
22
23  sources = [
24    "../../js_concurrent_module/common/helper/napi_helper.cpp",
25    "timer.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 {
39    if (is_standard_system) {
40      external_deps += [ "hilog:libhilog" ]
41    } else {
42      external_deps += [ "hilog:libhilog" ]
43    }
44  }
45
46  external_deps += [ "hitrace:hitrace_meter" ]
47
48  subsystem_name = "commonlibrary"
49  innerapi_tags = [ "platformsdk" ]
50  part_name = "ets_utils"
51}
52
53ohos_source_set("timer_static") {
54  include_dirs = [
55    js_concurrent_module_common,
56    "../timer",
57  ]
58
59  sources = [
60    "$js_concurrent_module_common/helper/napi_helper.cpp",
61    "timer.cpp",
62  ]
63
64  deps = []
65
66  defines = []
67
68  configs = [ "$napi_root:ace_napi_config" ]
69
70  if (is_cross_platform_build) {
71    include_dirs += [
72      "$plugins_root/hilog/include",
73      "$plugins_root/interfaces",
74    ]
75    deps += [
76      "$plugins_root/libs/napi:napi_${target_os}",
77      "$plugins_root/libs/uv:uv_${target_os}",
78    ]
79    if (target_os == "android") {
80      defines += [ "ANDROID_PLATFORM" ]
81    }
82    if (target_os == "ios") {
83      defines += [ "IOS_PLATFORM" ]
84    }
85  } else {
86    deps += [ "$napi_root:ace_napi" ]
87  }
88
89  subsystem_name = "commonlibrary"
90  part_name = "ets_utils"
91}
92group("timer_packages") {
93  deps = [ ":timer" ]
94}
95