From 3cf9952cb720e49e16c069038232bb58f2289a17 Mon Sep 17 00:00:00 2001 From: hui1975 Date: Mon, 12 Dec 2022 11:01:06 +0800 Subject: [PATCH] fix: vibrator BUILD.gn support custom vibrate Signed-off-by: hui1975 Change-Id: I429f391e4e22fa9c6e20d751091568c12277df60 --- vibrator/BUILD.gn | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/vibrator/BUILD.gn b/vibrator/BUILD.gn index 83be06999e..e19cbd54ac 100644 --- a/vibrator/BUILD.gn +++ b/vibrator/BUILD.gn @@ -11,15 +11,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -if (defined(ohos_lite)) { - group("vibrator_entry") { - deps = [ "//drivers/peripheral/vibrator/hal:hdi_vibrator" ] - } -} else { - group("vibrator_entry") { - deps = [ - "//drivers/peripheral/vibrator/hal:hdi_vibrator", - "//drivers/peripheral/vibrator/hdi_service:hdf_vibrator_service", - ] +group("vibrator_entry") { + deps = [] + if (defined(ohos_lite)) { + deps += [ "hal:hdi_vibrator" ] + } else { + HDI_VIBRATOR_SERVICE_PATH = + rebase_path("//device/soc/${device_company}/common/hal/vibrator") + cmd = "if [ -f ${HDI_VIBRATOR_SERVICE_PATH}/BUILD.gn ]; then echo true; else echo false; fi" + HAVE_VIBRATOR_DAL_SERVICE = + exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") + + if (HAVE_VIBRATOR_DAL_SERVICE) { + deps += [ "${HDI_VIBRATOR_SERVICE_PATH}:dal_service" ] + } else { + deps += [ + "//drivers/peripheral/vibrator/hal:hdi_vibrator", + "//drivers/peripheral/vibrator/hdi_service:hdf_vibrator_service", + ] + } } } -- Gitee