• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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/config/components/ets_frontend/ets2abc_config.gni")
15import("//build/ohos.gni")
16import("//build/ohos/taihe_idl/taihe.gni")
17import("../../../../powermgr.gni")
18
19copy_taihe_idl("copy_power_manager_runninglock") {
20  sources = [ "idl/ohos.runningLock.taihe" ]
21}
22
23ohos_taihe("run_taihe") {
24  taihe_generated_file_path = "${taihe_generated_file_path_runningLock}"
25  deps = [ ":copy_power_manager_runninglock" ]
26  outputs = [
27    "$taihe_generated_file_path/src/ohos.runningLock.ani.cpp",
28    "$taihe_generated_file_path/src/ohos.runningLock.abi.c",
29  ]
30}
31
32taihe_shared_library("power_manager_runninglock_taihe_native") {
33  branch_protector_ret = "pac_ret"
34  sanitize = {
35    cfi = true
36    cfi_cross_dso = true
37    debug = false
38  }
39  taihe_generated_file_path = "${taihe_generated_file_path_runningLock}"
40  sources = get_target_outputs(":run_taihe")
41  include_dirs = [ "./include" ]
42  configs = [
43    "${powermgr_utils_path}:utils_config",
44    "${powermgr_utils_path}:coverage_flags",
45  ]
46  sources += [
47    "src/ani_constructor.cpp",
48    "src/ohos.runningLock.impl.cpp",
49  ]
50  deps = [
51    ":run_taihe",
52    "${powermgr_inner_api}:powermgr_client",
53  ]
54  external_deps = [
55    "c_utils:utils",
56    "hilog:libhilog",
57    "ipc:ipc_core",
58  ]
59
60  subsystem_name = "powermgr"
61  part_name = "${powermgr_part_name}"
62}
63
64generate_static_abc("runningLock_abc") {
65  base_url = "${taihe_generated_file_path_runningLock}"
66  files = [ "${taihe_generated_file_path_runningLock}/@ohos.runningLock.ets" ]
67  is_boot_abc = "True"
68  device_dst_file = "/system/framework/runningLock_abc.abc"
69  dependencies = [ ":run_taihe" ]
70}
71
72ohos_prebuilt_etc("runningLock_etc") {
73  source = "$target_out_dir/runningLock_abc.abc"
74  module_install_dir = "framework"
75  subsystem_name = "powermgr"
76  part_name = "${powermgr_part_name}"
77  deps = [ ":runningLock_abc" ]
78}
79