• 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.
13#
14
15import("//build/ohos.gni")
16
17SENSOR_ROOT_DIR = "//drivers/peripheral/sensor"
18
19if (defined(ohos_lite)) {
20  config("libhdi_sensor_pub_config") {
21    visibility = [ ":*" ]
22  }
23
24  ohos_shared_library("hdi_sensor") {
25    output_extension = "z.so"
26    public_configs = [ ":libhdi_sensor_pub_config" ]
27    sources = [
28      "$SENSOR_ROOT_DIR/hal/src/sensor_channel.c",
29      "$SENSOR_ROOT_DIR/hal/src/sensor_controller.c",
30      "$SENSOR_ROOT_DIR/hal/src/sensor_manager.c",
31    ]
32
33    include_dirs = [
34      "$SENSOR_ROOT_DIR/hal/include",
35      "$SENSOR_ROOT_DIR/interfaces/include",
36      "//third_party/bounds_checking_function/include",
37    ]
38
39    deps = [
40      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
41      "//third_party/bounds_checking_function:libsec_shared",
42    ]
43    external_deps = [ "hdf_core:libhdf_utils" ]
44    cflags = [
45      "-Wall",
46      "-Wextra",
47      "-Werror",
48      "-fsigned-char",
49      "-fno-common",
50      "-fno-strict-aliasing",
51    ]
52    if (ohos_build_compiler != "clang") {
53      cflags += [
54        "-Wno-format",
55        "-Wno-format-extra-args",
56      ]
57    }
58    subsystem_name = "hdf"
59    part_name = "drivers_peripheral_sensor"
60  }
61} else {
62  config("libhdi_sensor_pub_config") {
63    visibility = [ ":*" ]
64
65    include_dirs = [ "$SENSOR_ROOT_DIR/interfaces/include" ]
66  }
67
68  ohos_shared_library("hdi_sensor") {
69    public_configs = [ ":libhdi_sensor_pub_config" ]
70    sources = [
71      "$SENSOR_ROOT_DIR/hal/src/sensor_channel.c",
72      "$SENSOR_ROOT_DIR/hal/src/sensor_controller.c",
73      "$SENSOR_ROOT_DIR/hal/src/sensor_manager.c",
74    ]
75
76    include_dirs = [
77      "$SENSOR_ROOT_DIR/hal/include",
78      "$SENSOR_ROOT_DIR/interfaces/include",
79      "//third_party/bounds_checking_function/include",
80    ]
81    defines = [ "__OHOS__USER__" ]
82    cflags = [
83      "-Wall",
84      "-Wextra",
85      "-Werror",
86      "-fsigned-char",
87      "-fno-common",
88      "-fno-strict-aliasing",
89    ]
90    install_images = [ chipset_base_dir ]
91    subsystem_name = "hdf"
92    part_name = "drivers_peripheral_sensor"
93    if (is_standard_system) {
94      external_deps = [
95        "c_utils:utils",
96        "hdf_core:libhdf_utils",
97        "hiviewdfx_hilog_native:libhilog",
98      ]
99    } else {
100      external_deps = [ "hilog:libhilog" ]
101    }
102  }
103}
104