hidapi: support mingw (#4750)

* hidapi: support mingw

* libusb: update cmake script to latest commit

* improve cmake find libusb.pc

* fix find pc
pull/4773/head
star9029 4 months ago committed by GitHub
parent 5b82ec7692
commit fee9f9dd31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      packages/h/hidapi/xmake.lua
  2. 2
      packages/l/libusb/xmake.lua

@ -18,7 +18,11 @@ package("hidapi")
add_deps("pkg-config") add_deps("pkg-config")
end end
on_install("windows|x86", "windows|x64", "linux", "macosx", function (package) on_install("windows|x86", "windows|x64", "linux", "macosx", "mingw", function (package)
io.replace("libusb/CMakeLists.txt",
"pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0>=1.0.9)",
"pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb)", {plain = true})
local configs = { local configs = {
"-DHIDAPI_WITH_TESTS=OFF", "-DHIDAPI_WITH_TESTS=OFF",
"-DHIDAPI_BUILD_PP_DATA_DUMP=OFF", "-DHIDAPI_BUILD_PP_DATA_DUMP=OFF",

@ -9,7 +9,7 @@ package("libusb")
add_versions("v1.0.27", "e8f18a7a36ecbb11fb820bd71540350d8f61bcd9db0d2e8c18a6fb80b214a3de") add_versions("v1.0.27", "e8f18a7a36ecbb11fb820bd71540350d8f61bcd9db0d2e8c18a6fb80b214a3de")
add_versions("v1.0.26", "a09bff99c74e03e582aa30759cada218ea8fa03580517e52d463c59c0b25e240") add_versions("v1.0.26", "a09bff99c74e03e582aa30759cada218ea8fa03580517e52d463c59c0b25e240")
add_resources(">=1.0.26", "libusb-cmake", "https://github.com/libusb/libusb-cmake.git", "84fb1bba4dde4c266944e7c7aa641a8a15d18f31") add_resources(">=1.0.26", "libusb-cmake", "https://github.com/libusb/libusb-cmake.git", "8f0b4a38fc3eefa2b26a99dff89e1c12bf37afd4")
if is_plat("macosx") then if is_plat("macosx") then
add_frameworks("CoreFoundation", "IOKit", "Security") add_frameworks("CoreFoundation", "IOKit", "Security")

Loading…
Cancel
Save