1# Copyright (c) 2022-2023 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
14import("//build/ohos.gni")
15import("../vibrator.gni")
16
17if (defined(ohos_lite)) {
18  group("hdf_vibrator_service") {
19    deps = []
20    public_configs = []
21  }
22} else {
23  ohos_shared_library("libvibrator_interface_service_1.3") {
24    include_dirs = [
25      "../interfaces/include/",
26      ".",
27      "../interfaces/v1_1/",
28      "../utils/include",
29    ]
30    sources = [ "vibrator_if_service.cpp" ]
31
32    cflags = [
33      "-Wall",
34      "-Wextra",
35      "-Werror",
36      "-fsigned-char",
37      "-fno-common",
38      "-fno-strict-aliasing",
39    ]
40
41    if (is_standard_system) {
42      external_deps = [
43        "drivers_interface_vibrator:libvibrator_stub_1.3",
44        "hdf_core:libhdf_host",
45        "hilog:libhilog",
46        "hitrace:hitrace_meter",
47        "ipc:ipc_single",
48      ]
49      if (c_utils_enable) {
50        external_deps += [ "c_utils:utils" ]
51      }
52    } else {
53      external_deps = [
54        "hilog:libhilog",
55        "ipc:ipc_single",
56      ]
57    }
58
59    install_images = [ chipset_base_dir ]
60    subsystem_name = "hdf"
61    part_name = "drivers_peripheral_vibrator"
62  }
63
64  ohos_shared_library("libvibrator_driver") {
65    include_dirs = [
66      "../interfaces/include/",
67      "../utils/include",
68    ]
69    sources = [ "vibrator_if_driver.cpp" ]
70
71    cflags = [
72      "-Wall",
73      "-Wextra",
74      "-Werror",
75      "-fsigned-char",
76      "-fno-common",
77      "-fno-strict-aliasing",
78    ]
79
80    if (is_standard_system) {
81      external_deps = [
82        "drivers_interface_vibrator:libvibrator_stub_1.1",
83        "drivers_interface_vibrator:libvibrator_stub_1.2",
84        "drivers_interface_vibrator:libvibrator_stub_1.3",
85        "hdf_core:libhdf_host",
86        "hdf_core:libhdf_ipc_adapter",
87        "hdf_core:libhdf_utils",
88        "hdf_core:libhdi",
89        "hilog:libhilog",
90        "ipc:ipc_single",
91      ]
92      if (c_utils_enable) {
93        external_deps += [ "c_utils:utils" ]
94      }
95    } else {
96      external_deps = [
97        "hilog:libhilog",
98        "ipc:ipc_single",
99      ]
100    }
101
102    shlib_type = "hdi"
103    install_images = [ chipset_base_dir ]
104    subsystem_name = "hdf"
105    part_name = "drivers_peripheral_vibrator"
106  }
107
108  group("hdf_vibrator_service") {
109    deps = [
110      ":libvibrator_driver",
111      ":libvibrator_interface_service_1.3",
112    ]
113  }
114}
115