• 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("../../../../thermalmgr.gni")
18
19copy_taihe_idl("copy_thermal_manager") {
20  sources = [ "idl/ohos.thermal.taihe" ]
21}
22
23ohos_taihe("run_taihe") {
24  taihe_generated_file_path = "$taihe_generated_file_path"
25  deps = [ ":copy_thermal_manager" ]
26  outputs = [
27    "$taihe_generated_file_path/src/ohos.thermal.ani.cpp",
28    "$taihe_generated_file_path/src/ohos.thermal.abi.c",
29  ]
30}
31
32config("thermal_private_config") {
33  include_dirs = [ "${thermal_service_zidl}/include" ]
34}
35
36taihe_shared_library("thermal_manager_taihe_native") {
37  branch_protector_ret = "pac_ret"
38  sanitize = {
39    cfi = true
40    cfi_cross_dso = true
41    debug = false
42  }
43  taihe_generated_file_path = "$taihe_generated_file_path"
44  sources = get_target_outputs(":run_taihe")
45  include_dirs = [ "./include" ]
46  configs = [
47    "${utils_path}:utils_config",
48    ":thermal_private_config",
49    "${utils_path}:coverage_flags",
50  ]
51  sources += [
52    "src/ani_constructor.cpp",
53    "src/ohos.thermal.impl.cpp",
54    "src/thermal_level_callback.cpp",
55  ]
56  deps = [
57    ":run_taihe",
58    "${thermal_inner_api}:thermalmgr_listener",
59    "${thermal_inner_api}:thermalsrv_client",
60  ]
61  external_deps = [
62    "bundle_framework:appexecfwk_base",
63    "c_utils:utils",
64    "hilog:libhilog",
65    "ipc:ipc_core",
66    "power_manager:powermgr_client",
67  ]
68
69  subsystem_name = "powermgr"
70  part_name = "${thermalmgr_native_part_name}"
71}
72
73generate_static_abc("thermal_abc") {
74  base_url = "$taihe_generated_file_path"
75  files = [ "$taihe_generated_file_path/@ohos.thermal.ets" ]
76  is_boot_abc = "True"
77  device_dst_file = "/system/framework/thermal_abc.abc"
78  dependencies = [ ":run_taihe" ]
79}
80
81generate_static_abc("thermal_test_abc") {
82  base_url = "$thermal_frameworks/ets/taihe/thermal/test"
83  files = [ "$thermal_frameworks/ets/taihe/thermal/test/test_main.ets" ]
84  is_boot_abc = "True"
85  device_dst_file = "/system/framework/thermal_test_abc.abc"
86}
87
88ohos_prebuilt_etc("thermal_etc") {
89  source = "$target_out_dir/thermal_abc.abc"
90  module_install_dir = "framework"
91  subsystem_name = "powermgr"
92  part_name = "${thermalmgr_native_part_name}"
93  deps = [ ":thermal_abc" ]
94}