improve is_plat

pull/13/head
ruki 6 years ago
parent f087c60c71
commit 569561358c
No known key found for this signature in database
GPG Key ID: 33341DF9719963FA
  1. 8
      packages/f/ffmpeg/xmake.lua
  2. 12
      packages/l/libpng/xmake.lua
  3. 15
      packages/l/libxml2/xmake.lua
  4. 6
      packages/l/lua/xmake.lua
  5. 7
      packages/l/luajit/xmake.lua
  6. 15
      packages/t/tbox/xmake.lua
  7. 6
      packages/x/x265/xmake.lua

@ -17,11 +17,9 @@ package("ffmpeg")
add_configs("libx264", {description = "Enable libx264 decoder.", default = false, type = "boolean"})
add_configs("libx265", {description = "Enable libx265 decoder.", default = false, type = "boolean"})
on_load(function (package)
if package:plat() == "macosx" then
package:add("frameworks", "CoreFoundation", "Foundation", "CoreVideo", "CoreMedia", "AudioToolbox")
end
end)
if is_plat("macosx") then
add_frameworks("CoreFoundation", "Foundation", "CoreVideo", "CoreMedia", "AudioToolbox")
end
on_install("linux", "macosx", function (package)
local configs = {"--disable-ffmpeg",

@ -13,13 +13,11 @@ package("libpng")
add_deps("cmake")
end
on_load(function (package)
if package:plat() == "windows" then
package:add("links", "libpng16_static")
else
package:add("links", "png")
end
end)
if is_plat("windows") then
add_links("libpng16_static")
else
add_links("png")
end
on_install("windows", function (package)
import("package.tools.cmake").install(package)

@ -13,15 +13,12 @@ package("libxml2")
end
add_includedirs("include/libxml2")
on_load(function (package)
if package:plat() == "windows" then
package:add("links", "libxml2_a")
package:add("syslinks", "wsock32", "ws2_32")
else
package:add("links", "xml2")
end
end)
if is_plat("windows") then
add_links("libxml2_a")
add_syslinks("wsock32", "ws2_32")
else
add_links("xml2")
end
if is_plat("windows") and winos.version():gt("winxp") then
on_install("windows", function (package)

@ -11,11 +11,11 @@ package("lua")
add_versions("5.1.5", "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333")
add_includedirs("include/lua")
if not is_plat("windows") then
add_syslinks("dl")
end
on_load(function (package)
if package:plat() ~= "windows" then
package:add("syslinks", "dl")
end
package:addenv("PATH", "bin")
end)

@ -15,12 +15,13 @@ package("luajit")
add_versions("2.0.5", "874b1f8297c697821f561f9b73b57ffd419ed8f4278c82e05b48806d30c1e979")
add_includedirs("include/luajit")
if not is_plat("windows") then
add_syslinks("dl")
end
on_load(function (package)
if package:plat() == "windows" then
if is_plat("windows") then
package:addenv("PATH", "lib")
else
package:add("syslinks", "dl")
end
package:addenv("PATH", "bin")
end)

@ -19,17 +19,18 @@ package("tbox")
add_configs(name, {description = "Enable the " .. name .. " package.", default = false, type = "boolean"})
end
if is_plat("windows") then
add_syslinks("ws2_32")
elseif is_plat("mingw") then
add_syslinks("ws2_32", "pthread")
else
add_syslinks("pthread")
end
on_load(function (package)
if package:debug() then
package:add("defines", "__tb_debug__")
end
if package:plat() == "windows" then
package:add("syslinks", "ws2_32")
elseif package:plat() == "mingw" then
package:add("syslinks", "ws2_32", "pthread")
else
package:add("syslinks", "pthread")
end
end)
on_install(function (package)

@ -9,9 +9,9 @@ package("x265")
add_deps("cmake", "nasm")
on_load("linux", "macosx", function (package)
package:add("syslinks", "c++")
end)
if is_plat("macosx") then
add_syslinks("c++")
end
on_install("linux", "macosx", function (package)
os.cd("build/linux")

Loading…
Cancel
Save