add meson #426
No reviewers
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi!426
Loading…
Reference in a new issue
No description provided.
Delete branch "meson"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Helps to avoid iconv problems that the CMake build has.
Signed-off-by: Rosen Penev rosenp@gmail.com
@ -0,0 +1,47 @@project('hidapi', 'c', version: files('VERSION'),meson_version: '>=0.60')The other build systems read the version from here, might as well do it for Meson too. ;)
@ -0,0 +13,4 @@if libusb_dep.found() and iconv_dep.found()libhidapi = library('hidapi-libusb','libusb/hid.c',dependencies: [ iconv_dep, libusb_dep ],This should depend on threads, I think.
Also, it is only called "-libusb" on linux.
And on Windows or macOS it uses the sources from windows/ or mac/ instead. See e.g.
github.com/libusb/hidapi@59e84ca74f/Makefile.am (L18-L40)@ -0,0 +29,4 @@if udev_dep.found() and host_machine.system() == 'linux'hidraw_lib = library('hidapi-hidraw','linux/hid.c',I think this is only built on Linux.
@ -0,0 +13,4 @@if libusb_dep.found() and iconv_dep.found()libhidapi = library('hidapi-libusb','libusb/hid.c',dependencies: [ iconv_dep, libusb_dep ],threads probably implicitly gets included with libusb.
edit: as for the others, I'd probably have to use wrapdb's CI for that. Need libusb first though.
@ -0,0 +1,47 @@project('hidapi', 'c', version: files('VERSION'),meson_version: '>=0.60')This works for project, specifically.
For libraries just use meson.project_version()...
@ -0,0 +1,7 @@option('hidraw', type : 'feature',description : 'Build hidraw. Requires udev.',@ -0,0 +3,4 @@)option('libusb', type : 'feature',description : 'Build hidapi. Requires libusb.',What does it solve compared to #410?
There is 0 known issues related to
iconv: https://github.com/libusb/hidapi/issues?q=is%3Aissue+is%3Aopen+iconvCan you elaborate?
didn't know there was another PR.
Anyway, issue is that when both external and internal iconv implementations exist, CMake's find_package(Iconv) fails to find iconv and terminates the build. More info here:
https://github.com/openwrt/packages/actions/runs/2477509891
https://github.com/openwrt/packages/pull/18738
solved by using dependency('iconv') which just works.
I'm pretty sure, we can find a solution to CMake's
find_package(Iconv).I do not support having yet another alternative build system for HIDAPI when it can be avoided - you'd have to duplicate the entire build logic we already have in CMake.
Lets focuse on #410 and #429 instead.
Pull request closed