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