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