• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2#Copyright (c) 2021 Huawei Device Co., Ltd.
3#Licensed under the Apache License, Version 2.0 (the "License");
4#you may not use this file except in compliance with the License.
5#You may obtain a copy of the License at
6#
7#    http://www.apache.org/licenses/LICENSE-2.0
8#
9#Unless required by applicable law or agreed to in writing, software
10#distributed under the License is distributed on an "AS IS" BASIS,
11#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12#See the License for the specific language governing permissions and
13#limitations under the License.
14#
15
16import("//build/ohos.gni")
17
18SENSOR_ROOT_DIR = "//drivers/peripheral/sensor"
19
20if (defined(ohos_lite)) {
21  config("libhdi_sensor_pub_config") {
22    visibility = [ ":*" ]
23  }
24
25  ohos_shared_library("hdi_sensor") {
26    output_extension = "z.so"
27    public_configs = [ ":libhdi_sensor_pub_config" ]
28    sources = [
29      "$SENSOR_ROOT_DIR/hal/src/sensor_channel.c",
30      "$SENSOR_ROOT_DIR/hal/src/sensor_controller.c",
31      "$SENSOR_ROOT_DIR/hal/src/sensor_manager.c",
32    ]
33
34    include_dirs = [
35      "$SENSOR_ROOT_DIR/hal/include",
36      "$SENSOR_ROOT_DIR/interfaces/include",
37      "//third_party/bounds_checking_function/include",
38    ]
39
40    deps = [
41      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
42      "//third_party/bounds_checking_function:libsec_shared",
43    ]
44    external_deps = [ "device_driver_framework:libhdf_utils" ]
45    cflags = [
46      "-Wall",
47      "-Wextra",
48      "-Werror",
49      "-fsigned-char",
50      "-fno-common",
51      "-fno-strict-aliasing",
52    ]
53    if (ohos_build_compiler != "clang") {
54      cflags += [
55        "-Wno-format",
56        "-Wno-format-extra-args",
57      ]
58    }
59    subsystem_name = "hdf"
60    part_name = "sensor_device_driver"
61  }
62} else {
63  config("libhdi_sensor_pub_config") {
64    visibility = [ ":*" ]
65
66    include_dirs = [ "$SENSOR_ROOT_DIR/interfaces/include" ]
67  }
68
69  ohos_shared_library("hdi_sensor") {
70    public_configs = [ ":libhdi_sensor_pub_config" ]
71    sources = [
72      "$SENSOR_ROOT_DIR/hal/src/sensor_channel.c",
73      "$SENSOR_ROOT_DIR/hal/src/sensor_controller.c",
74      "$SENSOR_ROOT_DIR/hal/src/sensor_manager.c",
75    ]
76
77    include_dirs = [
78      "$SENSOR_ROOT_DIR/hal/include",
79      "$SENSOR_ROOT_DIR/interfaces/include",
80      "//third_party/bounds_checking_function/include",
81    ]
82
83    deps = [ "//utils/native/base:utils" ]
84    defines = [ "__OHOS__USER__" ]
85    cflags = [
86      "-Wall",
87      "-Wextra",
88      "-Werror",
89      "-fsigned-char",
90      "-fno-common",
91      "-fno-strict-aliasing",
92    ]
93    install_images = [ chipset_base_dir ]
94    subsystem_name = "hdf"
95    part_name = "sensor_device_driver"
96    if (is_standard_system) {
97      external_deps = [
98        "device_driver_framework:libhdf_utils",
99        "hiviewdfx_hilog_native:libhilog",
100      ]
101    } else {
102      external_deps = [ "hilog:libhilog" ]
103    }
104  }
105}
106