summary refs log tree commit diff stats
path: root/plugins/sysinfo/meson.build
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2017-06-20 16:26:28 -0400
committerPatrick Griffis <tingping@tingping.se>2017-06-20 16:26:28 -0400
commit99e16110bc42856492636b4b492a0cffe6d70a88 (patch)
tree5e834a58c6cdf77114da6cbae2de35c8fffb0e71 /plugins/sysinfo/meson.build
parent2d184c09674b417bf294001d017b0d1ad2337de3 (diff)
sysinfo: Simplify finding pci.ids file on Unix
There is probably no reason to make this user configurable just
get the correct one at build time...
Diffstat (limited to 'plugins/sysinfo/meson.build')
-rw-r--r--plugins/sysinfo/meson.build11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/sysinfo/meson.build b/plugins/sysinfo/meson.build
index 2bee3e76..c589a590 100644
--- a/plugins/sysinfo/meson.build
+++ b/plugins/sysinfo/meson.build
@@ -9,6 +9,7 @@ sysinfo_deps = [
 ]
 
 sysinfo_includes = []
+sysinfo_cargs = []
 
 system = host_machine.system()
 if system == 'linux' or system == 'darwin'
@@ -18,7 +19,8 @@ if system == 'linux' or system == 'darwin'
   ]
 
   if system == 'linux'
-    sysinfo_deps += dependency('libpci')
+    libpci = dependency('libpci')
+    sysinfo_deps += libpci
     sysinfo_includes += 'unix'
     sysinfo_sources += [
       'unix/backend.c',
@@ -26,6 +28,10 @@ if system == 'linux' or system == 'darwin'
       'unix/parse.c',
       'unix/pci.c',
     ]
+
+    picidsdir = libpci.get_pkgconfig_variable('idsdir')
+    pciids = join_paths(picidsdir, 'pci.ids')
+    sysinfo_cargs += '-DPCIIDS_FILE="@0@"'.format(pciids)
   elif system == 'darwin'
     add_languages('objc')
     sysinfo_sources += 'osx/backend.m'
@@ -40,7 +46,8 @@ endif
 shared_module('sysinfo', sysinfo_sources,
   dependencies: sysinfo_deps,
   include_directories: include_directories(sysinfo_includes),
+  c_args: sysinfo_cargs,
   install: true,
   install_dir: plugindir,
   name_prefix: '',
-)
\ No newline at end of file
+)