diff --git a/vibrator/BUILD.gn b/vibrator/BUILD.gn index 83be06999e9cc2459a52a013fd148f66907c5ac4..e19cbd54ac5cc1f356f7d7ef55b4c682f77c12e4 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", + ] + } } }