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  } else {
51    external_deps = [
52      "hilog:libhilog",
53      "init:libbegetutil",
54      "ipc:ipc_single",
55      "libxml2:libxml2",
56      "zlib:libz",
57    ]
58  }
59
60  install_images = [ chipset_base_dir ]
61  subsystem_name = "hdf"
62  part_name = "drivers_peripheral_thermal"
63}
64
65##############################################################################################
66
67ohos_shared_library("libthermal_driver") {
68  include_dirs = [ "include" ]
69  sources = [ "src/thermal_interface_driver.cpp" ]
70
71  if (is_standard_system) {
72    external_deps = [
73      "drivers_interface_thermal:libthermal_stub_1.1",
74      "hdf_core:libhdf_host",
75      "hdf_core:libhdf_ipc_adapter",
76      "hdf_core:libhdf_utils",
77      "hdf_core:libhdi",
78      "hilog:libhilog",
79      "ipc:ipc_single",
80    ]
81    if (has_thermal_c_utils_part) {
82      external_deps += [ "c_utils:utils" ]
83    }
84  } else {
85    external_deps = [
86      "hilog:libhilog",
87      "ipc:ipc_single",
88    ]
89  }
90
91  shlib_type = "hdi"
92  install_images = [ chipset_base_dir ]
93  subsystem_name = "hdf"
94  part_name = "drivers_peripheral_thermal"
95}
96
97group("hdf_thermal") {
98  deps = [
99    ":libthermal_driver",
100    ":libthermal_interface_service_1.1",
101    "profile:thermal_hdf_config",
102  ]
103}
104