diff options
author | Thibault Payet <monwarez@gmail.com> | 2020-07-19 17:02:52 +0200 |
---|---|---|
committer | Thibault Payet <monwarez@gmail.com> | 2020-07-19 18:23:43 +0200 |
commit | 7a8615fa97cd2a3fae877665855bf7f5caf6bcc1 (patch) | |
tree | 1d958db50cb733db432e501fc1f34ecd712576f9 | |
parent | 89a73d88c9026b6347bea113896d24e419c4370c (diff) | |
download | libnitrokey-7a8615fa97cd2a3fae877665855bf7f5caf6bcc1.tar.gz libnitrokey-7a8615fa97cd2a3fae877665855bf7f5caf6bcc1.tar.bz2 |
When building on FreeBSD, use the correct name for hidapi, for the meson script use the correct libudev name
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | meson.build | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index db8d2fb..0d236f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,11 @@ IF(APPLE) ELSEIF(UNIX) # add_library(hidapi-libusb STATIC hidapi/libusb/hid.c ) find_package(PkgConfig) - pkg_search_module(HIDAPI_LIBUSB REQUIRED hidapi-libusb) + IF(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") + pkg_search_module(HIDAPI_LIBUSB REQUIRED hidapi) + ELSE() + pkg_search_module(HIDAPI_LIBUSB REQUIRED hidapi-libusb) + ENDIF() target_compile_options(nitrokey PRIVATE ${HIDAPI_LIBUSB_CFLAGS}) target_link_libraries(nitrokey ${HIDAPI_LIBUSB_LDFLAGS}) ELSEIF(WIN32) diff --git a/meson.build b/meson.build index c758a7a..8a51b66 100644 --- a/meson.build +++ b/meson.build @@ -26,7 +26,11 @@ if get_option('offline-tests') add_project_arguments(c.get_supported_arguments(test_cflags), language : 'c') endif -dep_hidapi = dependency('hidapi-libusb') +if target_machine.system() == 'freebsd' + dep_hidapi = dependency('hidapi') +else + dep_hidapi = dependency('hidapi-libusb') +endif inc_libnitrokey = include_directories('libnitrokey') libnitrokey_args = [] @@ -113,7 +117,11 @@ pkg.generate( install : true, ) -dep_udev = dependency('udev') +if target_machine.system() == 'freebsd' + dep_udev = dependency('libudev') +else + dep_udev = dependency('udev') +endif install_data( 'data/41-nitrokey.rules', install_dir : '@0@/rules.d'.format(dep_udev.get_pkgconfig_variable('udevdir')), |