meson: fix gpiod dependency

gpiod is not a "common" dependency, but only needed for specific
options.  Add it as a dependency only when necessary.

Name the dependency as `libgpiod_dep` to follow meson conventions.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ib650f5fe4e7085733f43eba608502e7e21a5c8db
diff --git a/meson.build b/meson.build
index 0bc6b7c..b00229d 100644
--- a/meson.build
+++ b/meson.build
@@ -69,23 +69,28 @@
 common_include = include_directories('.')
 
 common_build = build_tests.allowed() or get_option('bios-software-update').allowed() or get_option(
-    'i2cvr-software-update',
+    'cpld-software-update',
 ).allowed() or get_option(
     'eepromdevice-software-update',
 ).allowed() or get_option(
-    'cpld-software-update',
+    'i2cvr-software-update',
 ).allowed()
 
 if common_build
     libpldm_dep = dependency('libpldm')
+    subdir('common')
+endif
 
-    libgpiod = dependency(
+gpiod_needed = get_option('bios-software-update').allowed() or get_option(
+    'eepromdevice-software-update',
+).allowed()
+
+if gpiod_needed
+    libgpiod_dep = dependency(
         'libgpiodcxx',
         default_options: ['bindings=cxx'],
         version: '>=1.1.2',
     )
-
-    subdir('common')
 endif
 
 if get_option('bios-software-update').allowed()