1# Copyright (c) 2022-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.
13import("//build/ohos.gni")
14import("../../thermal.gni")
15
16ohos_shared_library("libthermal_interface_service_1.1") {
17  include_dirs = [ "include" ]
18  sources = [
19    "src/base_info_config.cpp",
20    "src/isolate_info_config.cpp",
21    "src/sensor_info_config.cpp",
22    "src/thermal_device_mitigation.cpp",
23    "src/thermal_dfx.cpp",
24    "src/thermal_hdf_config.cpp",
25    "src/thermal_hdf_timer.cpp",
26    "src/thermal_hdf_utils.cpp",
27    "src/thermal_interface_impl.cpp",
28    "src/thermal_simulation_node.cpp",
29    "src/thermal_zone_manager.cpp",
30  ]
31
32  if (is_standard_system) {
33    external_deps = [
34      "drivers_interface_thermal:libthermal_stub_1.1",
35      "hdf_core:libhdf_utils",
36      "hilog:libhilog",
37      "init:libbeget_proxy",
38      "init:libbegetutil",
39      "ipc:ipc_single",
40      "libxml2:libxml2",
41      "zlib:libz",
42    ]
43    if (has_thermal_c_utils_part) {
44      external_deps += [ "c_utils:utils" ]
45    }
46    if (has_thermal_config_policy_part) {
47      defines = [ "HAS_THERMAL_CONFIG_POLICY_PART" ]
48      external_deps += [ "config_policy:configpolicy_util" ]
49    }
50    if (has_thermal_hitrace_part) {
51      external_deps += [ "hitrace:hitrace_meter" ]
52      defines += [ "THERMAL_HITRACE_ENABLE" ]
53    }
54  } else {
55    external_deps = [
56      "hilog:libhilog",
57      "init:libbegetutil",
58      "ipc:ipc_single",
59      "libxml2:libxml2",
60      "zlib:libz",
61    ]
62  }
63
64  install_images = [ chipset_base_dir ]
65  subsystem_name = "hdf"
66  part_name = "drivers_peripheral_thermal"
67}
68
69##############################################################################################
70
71ohos_shared_library("libthermal_driver") {
72  include_dirs = [ "include" ]
73  sources = [ "src/thermal_interface_driver.cpp" ]
74
75  if (is_standard_system) {
76    external_deps = [
77      "drivers_interface_thermal:libthermal_stub_1.1",
78      "hdf_core:libhdf_host",
79      "hdf_core:libhdf_ipc_adapter",
80      "hdf_core:libhdf_utils",
81      "hdf_core:libhdi",
82      "hilog:libhilog",
83      "ipc:ipc_single",
84    ]
85    if (has_thermal_c_utils_part) {
86      external_deps += [ "c_utils:utils" ]
87    }
88  } else {
89    external_deps = [
90      "hilog:libhilog",
91      "ipc:ipc_single",
92    ]
93  }
94
95  shlib_type = "hdi"
96  install_images = [ chipset_base_dir ]
97  subsystem_name = "hdf"
98  part_name = "drivers_peripheral_thermal"
99}
100
101group("hdf_thermal") {
102  deps = [
103    ":libthermal_driver",
104    ":libthermal_interface_service_1.1",
105    "profile:thermal_hdf_config",
106  ]
107}
108