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.
13
14import("../device_status.gni")
15
16config("devicestatus_private_config") {
17  include_dirs = [ "${device_status_interfaces_path}/innerkits/include" ]
18}
19
20config("devicestatus_srv_public_config") {
21  include_dirs = [
22    "include",
23    "interface",
24    "include/algorithm",
25    "include/datahub",
26  ]
27}
28
29ohos_shared_library("devicestatus_mock") {
30  sources = [
31    "src/devicestatus_data_parse.cpp",
32    "src/devicestatus_msdp_mock.cpp",
33  ]
34
35  configs = [
36    "${device_status_utils_path}:devicestatus_utils_config",
37    ":devicestatus_private_config",
38  ]
39
40  public_configs = [ ":devicestatus_srv_public_config" ]
41
42  deps = [ "${device_status_utils_path}:devicestatus_util" ]
43
44  external_deps = [
45    "cJSON:cjson_static",
46    "hilog:libhilog",
47  ]
48
49  defines = []
50  if (device_status_sensor_enable) {
51    external_deps += [ "sensor:sensor_interface_native" ]
52    defines += [ "DEVICE_STATUS_SENSOR_ENABLE" ]
53  }
54
55  subsystem_name = "${device_status_subsystem_name}"
56  part_name = "${device_status_part_name}"
57}
58
59ohos_shared_library("devicestatus_algo") {
60  branch_protector_ret = "pac_ret"
61  sanitize = {
62    integer_overflow = true
63    ubsan = true
64    boundary_sanitize = true
65    cfi = true
66    cfi_cross_dso = true
67    debug = false
68  }
69  sources = [
70    "src/algorithm/algo_absolute_still.cpp",
71    "src/algorithm/algo_base.cpp",
72    "src/algorithm/algo_horizontal.cpp",
73    "src/algorithm/algo_vertical.cpp",
74    "src/datahub/sensor_data_callback.cpp",
75    "src/devicestatus_algorithm_manager.cpp",
76  ]
77
78  configs = [
79    "${device_status_utils_path}:devicestatus_utils_config",
80    ":devicestatus_private_config",
81  ]
82
83  public_configs = [ ":devicestatus_srv_public_config" ]
84
85  deps = [
86    "${device_status_interfaces_path}/innerkits:devicestatus_client",
87    "${device_status_utils_path}:devicestatus_util",
88  ]
89
90  external_deps = [
91    "ability_base:base",
92    "cJSON:cjson_static",
93    "hilog:libhilog",
94    "input:libmmi-client",
95    "ipc:ipc_single",
96    "safwk:system_ability_fwk",
97    "samgr:samgr_proxy",
98  ]
99  defines = []
100  if (device_status_sensor_enable) {
101    external_deps += [ "sensor:sensor_interface_native" ]
102    defines += [ "DEVICE_STATUS_SENSOR_ENABLE" ]
103  }
104
105  subsystem_name = "${device_status_subsystem_name}"
106  part_name = "${device_status_part_name}"
107}
108