summary refs log tree commit diff stats
path: root/plugins/sysinfo/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/sysinfo/meson.build')
-rw-r--r--plugins/sysinfo/meson.build9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/sysinfo/meson.build b/plugins/sysinfo/meson.build
index c589a590..5656724e 100644
--- a/plugins/sysinfo/meson.build
+++ b/plugins/sysinfo/meson.build
@@ -19,14 +19,17 @@ if system == 'linux' or system == 'darwin'
   ]
 
   if system == 'linux'
-    libpci = dependency('libpci')
-    sysinfo_deps += libpci
+    libpci = dependency('libpci', required: false)
+    if libpci.found()
+      sysinfo_deps += libpci
+      sysinfo_cargs += '-DHAVE_LIBPCI'
+      sysinfo_sources += 'unix/pci.c'
+    endif
     sysinfo_includes += 'unix'
     sysinfo_sources += [
       'unix/backend.c',
       'unix/match.c',
       'unix/parse.c',
-      'unix/pci.c',
     ]
 
     picidsdir = libpci.get_pkgconfig_variable('idsdir')