summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabiano Fidêncio <fidencio@redhat.com>2019-12-03 23:48:16 +0100
committerFabiano Fidêncio <fidencio@redhat.com>2019-12-04 12:20:23 +0100
commit1410f1b7b8a375a9ff003d5c7b16d711cd782875 (patch)
tree58b6305673130014a59e0e2843a6a25254af0e6b
parentbdef1d5366374ee1072d46d51818a9538da605a5 (diff)
downloadlibosinfo-1410f1b7b8a375a9ff003d5c7b16d711cd782875.tar.gz
build: Only define {PCI,USB}_IDS in {pci,usb}-ids-path are defined
Setting those regardless of {pci,usb}-ids-path being explicitly set or automatically detected is a regression compared to what we were doing when using autotools. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
-rw-r--r--meson.build12
1 files changed, 8 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index 3f2109b..29f090a 100644
--- a/meson.build
+++ b/meson.build
@@ -284,8 +284,10 @@ if pci_ids_path == ''
pci_ids_path = join_paths(libosinfo_pkgdatadir, 'pci.ids')
endif
endif
-libosinfo_cflags += ['-DPCI_IDS="@0@"'.format(pci_ids_path)]
-message('Location of pci.ids: "@0@"'.format(pci_ids_path))
+if pci_ids_path != ''
+ libosinfo_cflags += ['-DPCI_IDS="@0@"'.format(pci_ids_path)]
+ message('Location of pci.ids: "@0@"'.format(pci_ids_path))
+endif
usb_ids_path = get_option('with-usb-ids-path')
if usb_ids_path == ''
@@ -321,8 +323,10 @@ if usb_ids_path == ''
usb_ids_path = join_paths(libosinfo_pkgdatadir, 'usb.ids')
endif
endif
-libosinfo_cflags += ['-DUSB_IDS="@0@"'.format(usb_ids_path)]
-message('Location of usb.ids: "@0@"'.format(usb_ids_path))
+if usb_ids_path != ''
+ libosinfo_cflags += ['-DUSB_IDS="@0@"'.format(usb_ids_path)]
+ message('Location of usb.ids: "@0@"'.format(usb_ids_path))
+endif
add_project_arguments(libosinfo_cflags, language: 'c')