• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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("//drivers/adapter/uhdf2/uhdf.gni")
15
16ohos_shared_library("libsensor_service_1.0") {
17  include_dirs = [ "//drivers/peripheral/sensor/interfaces/include/" ]
18  sources = [ "sensor_impl.cpp" ]
19
20  public_deps = [
21    "//drivers/interface/sensor/v1_0:libsensor_stub_1.0",
22    "//drivers/peripheral/sensor/hal:hdi_sensor",
23  ]
24
25  cflags = [
26    "-Wall",
27    "-Wextra",
28    "-Werror",
29    "-fsigned-char",
30    "-fno-common",
31    "-fno-strict-aliasing",
32  ]
33
34  if (is_standard_system) {
35    external_deps = [
36      "device_driver_framework:libhdf_ipc_adapter",
37      "device_driver_framework:libhdf_utils",
38      "hiviewdfx_hilog_native:libhilog",
39      "ipc:ipc_single",
40      "utils_base:utils",
41    ]
42  } else {
43    external_deps = [
44      "hilog:libhilog",
45      "ipc:ipc_single",
46    ]
47  }
48
49  install_images = [ chipset_base_dir ]
50  subsystem_name = "hdf"
51  part_name = "sensor_device_driver"
52}
53
54ohos_shared_library("libsensor_driver") {
55  include_dirs = [ "//drivers/peripheral/sensor/interfaces/include/" ]
56
57  sources = [ "sensor_interface_driver.cpp" ]
58
59  deps = [ "//drivers/peripheral/sensor/hdi_service:libsensor_service_1.0" ]
60
61  cflags = [
62    "-Wall",
63    "-Wextra",
64    "-Werror",
65    "-fsigned-char",
66    "-fno-common",
67    "-fno-strict-aliasing",
68  ]
69
70  if (is_standard_system) {
71    external_deps = [
72      "device_driver_framework:libhdf_host",
73      "device_driver_framework:libhdf_ipc_adapter",
74      "device_driver_framework:libhdf_utils",
75      "device_driver_framework:libhdi",
76      "hiviewdfx_hilog_native:libhilog",
77      "ipc:ipc_single",
78      "utils_base:utils",
79    ]
80  } else {
81    external_deps = [
82      "hilog:libhilog",
83      "ipc:ipc_single",
84    ]
85  }
86
87  install_images = [ chipset_base_dir ]
88  subsystem_name = "hdf"
89  part_name = "sensor_device_driver"
90}
91
92group("hdi_sensor_service") {
93  if (target_cpu == "arm") {
94    deps = [
95      ":libsensor_driver",
96      ":libsensor_service_1.0",
97    ]
98  }
99}
100