1# Copyright (C) 2021-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("../../thermalmgr.gni")
15
16config("thermal_protector_public_config") {
17  include_dirs = [
18    "include",
19    "include/policy",
20    "include/action",
21  ]
22}
23
24ohos_executable("thermal_protector") {
25  sources = [
26    "src/action/cpu_action.cpp",
27    "src/action/current_action.cpp",
28    "src/action/device_control_factory.cpp",
29    "src/action/thermal_device_control.cpp",
30    "src/action/voltage_action.cpp",
31    "src/main.cpp",
32    "src/policy/protector_thermal_zone_info.cpp",
33    "src/policy/thermal_kernel_config_file.cpp",
34    "src/policy/thermal_kernel_policy.cpp",
35    "src/thermal_kernel_service.cpp",
36    "src/thermal_protector_timer.cpp",
37    "src/thermal_protector_utils.cpp",
38    "src/thermal_sensor_provision.cpp",
39  ]
40
41  public_configs = [ ":thermal_protector_public_config" ]
42
43  configs = [
44    "${utils_path}:utils_config",
45    "${utils_path}:coverage_flags",
46  ]
47
48  deps = [ "${utils_path}:thermal_utils" ]
49
50  external_deps = [
51    "c_utils:utils",
52    "config_policy:configpolicy_util",
53    "hilog:libhilog",
54    "libxml2:libxml2",
55  ]
56
57  install_enable = true
58  part_name = "thermal_manager"
59  subsystem_name = "powermgr"
60}
61
62group("thermal_protector_group") {
63  deps = [
64    ":thermal_protector",
65    "profile:thermal_kernel_config",
66  ]
67}
68