improve sdl to support bsd (#414)

pull/417/head
ruki 4 years ago committed by GitHub
parent dd89da5d76
commit 53d1417fd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      packages/l/libsdl/xmake.lua

@ -18,7 +18,10 @@ package("libsdl")
if is_plat("macosx") then if is_plat("macosx") then
add_frameworks("OpenGL", "CoreVideo", "CoreAudio", "AudioToolbox", "Carbon", "CoreGraphics", "ForceFeedback", "Metal", "AppKit", "IOKit", "CoreFoundation", "Foundation") add_frameworks("OpenGL", "CoreVideo", "CoreAudio", "AudioToolbox", "Carbon", "CoreGraphics", "ForceFeedback", "Metal", "AppKit", "IOKit", "CoreFoundation", "Foundation")
add_syslinks("iconv") add_syslinks("iconv")
elseif is_plat("linux") then elseif is_plat("linux", "bsd") then
if is_plat("bsd") then
add_syslinks("usbhid")
end
add_syslinks("pthread", "dl") add_syslinks("pthread", "dl")
elseif is_plat("windows", "mingw") then elseif is_plat("windows", "mingw") then
add_syslinks("gdi32", "user32", "winmm", "shell32") add_syslinks("gdi32", "user32", "winmm", "shell32")
@ -43,7 +46,7 @@ package("libsdl")
end end
end) end)
on_fetch("linux", "macosx", function (package, opt) on_fetch("linux", "macosx", "bsd", function (package, opt)
if opt.system then if opt.system then
-- use sdl2-config -- use sdl2-config
local sdl2conf = try {function() return os.iorunv("sdl2-config", {"--version", "--cflags", "--libs"}) end} local sdl2conf = try {function() return os.iorunv("sdl2-config", {"--version", "--cflags", "--libs"}) end}
@ -101,7 +104,7 @@ package("libsdl")
os.cp(path.join("lib", arch, "*.dll"), package:installdir("bin")) os.cp(path.join("lib", arch, "*.dll"), package:installdir("bin"))
end) end)
on_install("macosx", "linux", function (package) on_install("macosx", "linux", "bsd", function (package)
local configs = {} local configs = {}
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no")) table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes")) table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))

Loading…
Cancel
Save