Remove redundant dependency calls

- In the current state, the build system has too many
  dependency calls, because of which meson tries to find
  the same dependendency mutiple times & prints a trace
  on the console.This would have been an ideal solution
  when all the subdirectories are subprojects in meson but
  in the current context it is not.

- Even though meson uses the cached dependency objects
  rather than fetching them every time, it might not
  give any added advantage on the performance front.

- But checking for the same dependency mutiple times gives
  a false impression to the users & this can be avoided by
  re-using the dependency objects across subdirectories.

Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: Ic428b2ab1897e4dc4a0024164c07fd416c927da1
diff --git a/configurations/meson.build b/configurations/meson.build
index 440f5a6..c7ddf0c 100644
--- a/configurations/meson.build
+++ b/configurations/meson.build
@@ -1,4 +1,3 @@
-systemd = dependency('systemd')
 systemd_system_unit_dir = systemd.get_pkgconfig_variable(
     'systemdsystemunitdir',
     define_variable: ['prefix', get_option('prefix')])
diff --git a/libpldmresponder/meson.build b/libpldmresponder/meson.build
index f14ecb7..50ca692 100644
--- a/libpldmresponder/meson.build
+++ b/libpldmresponder/meson.build
@@ -1,7 +1,7 @@
 deps = [
-  dependency('phosphor-dbus-interfaces'),
-  dependency('sdbusplus'),
-  dependency('sdeventplus'),
+  phosphor_dbus_interfaces,
+  sdbusplus,
+  sdeventplus,
   libpldm,
   libpldmutils
 ]
diff --git a/meson.build b/meson.build
index 9898884..0c50ba8 100644
--- a/meson.build
+++ b/meson.build
@@ -37,6 +37,11 @@
   configuration: conf_data
 )
 
+phosphor_dbus_interfaces = dependency('phosphor-dbus-interfaces')
+sdbusplus = dependency('sdbusplus')
+sdeventplus = dependency('sdeventplus')
+systemd = dependency('systemd')
+
 subdir('libpldm')
 
 if get_option('libpldm-only').disabled()
@@ -48,8 +53,8 @@
   version: meson.project_version(),
   dependencies: [
       libpldm,
-      dependency('phosphor-dbus-interfaces'),
-      dependency('sdbusplus'),
+      phosphor_dbus_interfaces,
+      sdbusplus,
   ],
   install: true,
   include_directories: include_directories(libpldmutils_headers),
@@ -65,9 +70,9 @@
   libpldmutils,
   libpldmresponder,
   libpldmutils,
-  dependency('sdbusplus'),
-  dependency('sdeventplus'),
-  dependency('phosphor-dbus-interfaces')
+  sdbusplus,
+  sdeventplus,
+  phosphor_dbus_interfaces
 ]
 
 executable(
diff --git a/pldmtool/meson.build b/pldmtool/meson.build
index f6eda88..1d98e23 100644
--- a/pldmtool/meson.build
+++ b/pldmtool/meson.build
@@ -20,6 +20,6 @@
   sources,
   implicit_include_directories: false,
   include_directories: include_directories(libpldm_headers),
-  dependencies: [libpldm, libpldmutils, dependency('sdbusplus')],
+  dependencies: [libpldm, libpldmutils, sdbusplus],
   install: true,
   install_dir: get_option('bindir'))
diff --git a/softoff/meson.build b/softoff/meson.build
index 753375b..0ef11f1 100644
--- a/softoff/meson.build
+++ b/softoff/meson.build
@@ -1,9 +1,9 @@
 deps = [
     libpldm,
     libpldmutils,
-    dependency('sdeventplus'),
-    dependency('sdbusplus'),
-    dependency('phosphor-dbus-interfaces'),
+    sdeventplus,
+    sdbusplus,
+    phosphor_dbus_interfaces,
     ]
 
 source = ['main.cpp','softoff.cpp']
@@ -14,7 +14,6 @@
            install: true,
            install_dir: get_option('bindir'))
 
-systemd = dependency('systemd')
 servicedir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
 
 configure_file(input: 'services/pldmSoftPowerOff.service',
diff --git a/test/meson.build b/test/meson.build
index 1972b02..fd1a2ec 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -58,8 +58,8 @@
                          gtest,
                          gmock,
                          pldmd,
-                         dependency('phosphor-dbus-interfaces'),
-                         dependency('sdeventplus'),
-                         dependency('sdbusplus')]),
+                         phosphor_dbus_interfaces,
+                         sdeventplus,
+                         sdbusplus]),
        workdir: meson.current_source_dir())
 endforeach
diff --git a/utilities/meson.build b/utilities/meson.build
index 98d2807..b9ee4c6 100644
--- a/utilities/meson.build
+++ b/utilities/meson.build
@@ -1,4 +1,4 @@
-deps = [ libpldm, dependency('sdeventplus') ]
+deps = [ libpldm, sdeventplus ]
 
 executable('set-state-effecter', 'requester/set_state_effecter.cpp',
            implicit_include_directories: false,