diff options
author | Richard Hughes <richard@hughsie.com> | 2021-05-20 22:01:47 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2021-05-21 10:59:20 +0100 |
commit | a050309250f87ec733469c6b8030757ab8304c42 (patch) | |
tree | c498596647b1e917122e17e20c3d41eb58ed0da3 /meson.build | |
parent | f889d9801f490b67558b2c7a71dc1f3e1eb445a7 (diff) | |
download | gusb-a050309250f87ec733469c6b8030757ab8304c42.tar.gz |
Lower the libusb dep to fix compile on FreeBSD
FreeBSD is not a supported platform of libusb. The native USB access library
on FreeBSD is libusb20, which provides both the non-portable FreeBSD-specific
API and wrapper functions that are mostly compatible eith libusb 1.0 API.
It is an integral part of FreeBSD and the version included in the oldest
supported FreeBSD release reports 1.0.9 in its libusb-1.0.pc.
Based on a patch by Ting-Wei Lan <lantw@src.gnome.org>, many thanks.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/meson.build b/meson.build index 0cc4ea9..ba1f314 100644 --- a/meson.build +++ b/meson.build @@ -94,9 +94,15 @@ add_project_link_arguments( ) libgio = dependency('gio-2.0', version : '>= 2.44.0') -libusb = dependency('libusb-1.0', version : '>= 1.0.19') -if libusb.version().version_compare ('>= 1.0.22') - conf.set('HAVE_LIBUSB_1_0_22', '1') +libusb = dependency('libusb-1.0', version : '>= 1.0.9') +if cc.has_header_symbol('libusb-1.0/libusb.h', 'LIBUSB_CAP_HAS_HOTPLUG') + conf.set('HAVE_LIBUSB_CAP_HAS_HOTPLUG', '1') +endif +if cc.has_header_symbol('libusb-1.0/libusb.h', 'libusb_has_capability') + conf.set('HAVE_LIBUSB_HAS_CAPABILITY', '1') +endif +if cc.has_header_symbol('libusb-1.0/libusb.h', 'libusb_set_option') + conf.set('HAVE_LIBUSB_SET_OPTION', '1') endif gusb_deps = [ |