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 16if (defined(ohos_lite)) { 17 import("//build/lite/config/component/lite_component.gni") 18} else { 19 import("//build/ohos.gni") 20} 21 22VIBRATRO_ROOT_DIR = "//drivers/peripheral/misc/vibrator" 23 24if (defined(ohos_lite)) { 25 FWK_ROOT_DIR = "//drivers/framework" 26 shared_library("hdi_vibrator") { 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 "$FWK_ROOT_DIR/include", 33 "$FWK_ROOT_DIR/include/utils", 34 "$FWK_ROOT_DIR/include/osal", 35 "$FWK_ROOT_DIR/include/core", 36 "$FWK_ROOT_DIR/ability/sbuf/include", 37 "//drivers/adapter/uhdf/posix/include", 38 "//third_party/bounds_checking_function/include", 39 ] 40 41 deps = [ 42 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 43 "//drivers/adapter/uhdf/manager:hdf_core", 44 "//drivers/adapter/uhdf/posix:hdf_posix_osal", 45 "//third_party/bounds_checking_function:libsec_shared", 46 ] 47 public_deps = [ "//third_party/bounds_checking_function:libsec_shared" ] 48 49 cflags = [ 50 "-Wall", 51 "-Wextra", 52 "-Werror", 53 "-fsigned-char", 54 "-fno-common", 55 "-fno-strict-aliasing", 56 ] 57 } 58 59 lite_component("hdi") { 60 features = [ ":hdi_vibrator" ] 61 } 62} else { 63 config("libhdi_vibrator_pub_config") { 64 visibility = [ ":*" ] 65 include_dirs = [ "$VIBRATRO_ROOT_DIR/interfaces/include" ] 66 } 67 ohos_shared_library("hdi_vibrator") { 68 public_configs = [ ":libhdi_vibrator_pub_config" ] 69 sources = [ "$VIBRATRO_ROOT_DIR/hal/src/vibrator_controller.c" ] 70 71 include_dirs = [ 72 "$VIBRATRO_ROOT_DIR/hal/include", 73 "//third_party/bounds_checking_function/include", 74 ] 75 76 deps = [ 77 "//drivers/adapter/uhdf2/osal:libhdf_utils", 78 "//utils/native/base:utils", 79 ] 80 81 cflags = [ 82 "-Wall", 83 "-Wextra", 84 "-Werror", 85 "-fsigned-char", 86 "-fno-common", 87 "-fno-strict-aliasing", 88 ] 89 subsystem_name = "hdf" 90 if (is_standard_system) { 91 external_deps = [ "hiviewdfx_hilog_native:libhilog" ] 92 } else { 93 external_deps = [ "hilog:libhilog" ] 94 } 95 } 96} 97