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