improve libusb (#1641)

* improve libusb

* Update xmake.lua
pull/1642/head
ruki 2 years ago committed by GitHub
parent 59c6612475
commit a07053e7a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      packages/l/libusb/xmake.lua

@ -25,7 +25,7 @@ package("libusb")
if is_plat("macosx") then
add_frameworks("CoreFoundation", "IOKit")
elseif is_plat("linux") then
elseif is_plat("linux", "bsd") then
add_syslinks("pthread")
end
@ -73,7 +73,7 @@ package("libusb")
end
end)
on_install("mingw", function (package)
on_install("mingw", function (package)
os.cp("include/libusb-1.0/*.h",package:installdir("include/libusb-1.0"))
if package:is_arch("x64", "x86_64") then
os.cp("MinGW64/dll/*", package:installdir("bin"))
@ -83,14 +83,11 @@ package("libusb")
os.cp("MinGW32/static/*", package:installdir("lib"))
end
end)
on_install("macosx", "linux", function (package)
on_install("macosx", "linux", "bsd", function (package)
local configs = {}
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
if package:config("pic") ~= false then
table.insert(configs, "--with-pic")
end
local cflags, ldflags
if package:is_plat("linux") then
cflags = "-I" .. package:dep("eudev"):installdir("include")

Loading…
Cancel
Save