• 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
18VIBRATRO_ROOT_DIR = "//drivers/peripheral/misc/vibrator"
19
20if (defined(ohos_lite)) {
21  config("libhdi_vibrator_pub_config") {
22    visibility = [ ":*" ]
23    include_dirs = []
24  }
25  ohos_shared_library("hdi_vibrator") {
26    output_extension = "z.so"
27    public_configs = [ ":libhdi_vibrator_pub_config" ]
28    sources = [ "$VIBRATRO_ROOT_DIR/hal/src/vibrator_controller.c" ]
29
30    include_dirs = [
31      "$VIBRATRO_ROOT_DIR/hal/include",
32      "$VIBRATRO_ROOT_DIR/interfaces/include",
33      "//third_party/bounds_checking_function/include",
34    ]
35
36    deps = [
37      "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
38      "//third_party/bounds_checking_function:libsec_shared",
39    ]
40    external_deps = [ "device_driver_framework:libhdf_utils" ]
41    public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
42
43    cflags = [
44      "-Wall",
45      "-Wextra",
46      "-Werror",
47      "-fsigned-char",
48      "-fno-common",
49      "-fno-strict-aliasing",
50    ]
51    subsystem_name = "hdf"
52    part_name = "vibrator_device_driver"
53  }
54} else {
55  config("libhdi_vibrator_pub_config") {
56    visibility = [ ":*" ]
57    include_dirs = [ "$VIBRATRO_ROOT_DIR/interfaces/include" ]
58  }
59  ohos_shared_library("hdi_vibrator") {
60    public_configs = [ ":libhdi_vibrator_pub_config" ]
61    sources = [ "$VIBRATRO_ROOT_DIR/hal/src/vibrator_controller.c" ]
62
63    include_dirs = [
64      "$VIBRATRO_ROOT_DIR/hal/include",
65      "//third_party/bounds_checking_function/include",
66    ]
67
68    cflags = [
69      "-Wall",
70      "-Wextra",
71      "-Werror",
72      "-fsigned-char",
73      "-fno-common",
74      "-fno-strict-aliasing",
75    ]
76    install_images = [ chipset_base_dir ]
77    subsystem_name = "hdf"
78    part_name = "vibrator_device_driver"
79    if (is_standard_system) {
80      external_deps = [
81        "device_driver_framework:libhdf_utils",
82        "hiviewdfx_hilog_native:libhilog",
83        "utils_base:utils",
84      ]
85    } else {
86      external_deps = [ "hilog:libhilog" ]
87    }
88  }
89}
90