* add asio

* make irrlicht tools optional
pull/698/head
Hoildkv 3 years ago committed by GitHub
parent 05c2860a06
commit 99c11d48e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 31
      packages/a/asio/xmake.lua
  2. 15
      packages/i/irrlicht/port/xmake.lua
  3. 13
      packages/i/irrlicht/xmake.lua

@ -0,0 +1,31 @@
package("asio")
set_kind("library", {headeronly = true})
set_homepage("http://think-async.com/Asio/")
set_description("Asio is a cross-platform C++ library for network and low-level I/O programming that provides developers with a consistent asynchronous model using a modern C++ approach.")
set_license("BSL-1.0")
add_urls("https://sourceforge.net/projects/asio/files/asio/$(version) (Stable)/asio-$(version).tar.gz", {alias = "sourceforge"})
add_urls("https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-$(version).tar.gz", {alias = "github", version = function (version) return version:gsub("%.", "-") end})
add_versions("sourceforge:1.20.0", "4cd5cd0ad97e752a4075f02778732a3737b587f5eeefab59cd98dc43b0dcadb3")
add_versions("github:1.20.0", "34a8f07be6f54e3753874d46ecfa9b7ab7051c4e3f67103c52a33dfddaea48e6")
on_install(function (package)
if os.isdir("asio") then
os.cp("asio/include/asio.hpp", package:installdir("include"))
os.cp("asio/include/asio", package:installdir("include"))
else
os.cp("include/asio.hpp", package:installdir("include"))
os.cp("include/asio", package:installdir("include"))
end
end)
on_test(function (package)
assert(package:check_cxxsnippets({test = [[
void test() {
asio::io_context io_context;
asio::steady_timer timer(io_context);
timer.expires_at(asio::steady_timer::clock_type::time_point::min());
}
]]}, {configs = {languages = "c++14"}, includes = "asio.hpp"}))
end)

@ -1,12 +1,15 @@
set_project("irrlicht")
option("tools", {default = false, showmenu = true})
add_rules("mode.debug", "mode.release")
add_requires("bzip2", "libjpeg-turbo", "libpng", "zlib")
if is_plat("macosx") then
add_requires("libx11", "libxft")
elseif is_plat("linux") then
add_requires("libx11", "libxxf86vm", "libxcursor", "libxext", "libxft")
if is_plat("linux") then
add_requires("libx11", "libxxf86vm", "libxcursor", "libxext")
end
if has_config("tools") and is_plat("macosx", "linux") then
add_requires("libxft")
end
target("Irrlicht")
@ -38,6 +41,7 @@ target("Irrlicht")
end
target_end()
if has_config("tools") then
target("MeshConverter")
set_kind("binary")
add_deps("Irrlicht")
@ -51,7 +55,7 @@ target("IrrFontTool")
if is_plat("windows") then
add_syslinks("gdi32")
elseif is_plat("macosx", "linux") then
add_packages("libx11", "libxft")
add_packages("libxft")
end
target_end()
@ -66,3 +70,4 @@ target("FileToHeader")
add_deps("Irrlicht")
add_files("tools/FileToHeader/*.cpp")
target_end()
end

@ -7,25 +7,32 @@ package("irrlicht")
add_urls("https://downloads.sourceforge.net/irrlicht/irrlicht-$(version).zip")
add_versions("1.8.5", "effb7beed3985099ce2315a959c639b4973aac8210f61e354475a84105944f3d")
add_configs("tools", {description = "Build tools.", default = false, type = "boolean"})
add_deps("bzip2", "libjpeg-turbo", "libpng", "zlib")
if is_plat("windows") then
add_syslinks("user32", "gdi32", "advapi32")
elseif is_plat("macosx") then
add_deps("libx11", "libxft")
add_frameworks("Cocoa", "OpenGL", "IOKit")
elseif is_plat("linux") then
add_syslinks("GL")
add_deps("libx11", "libxxf86vm", "libxcursor", "libxext", "libxft")
add_deps("libx11", "libxxf86vm", "libxcursor", "libxext")
end
on_load("windows", "macosx", "linux", function (package)
if not package:config("shared") then
package:add("defines", "_IRR_STATIC_LIB_")
end
if package:is_plat("macosx", "linux") and package:config("tools") then
package:add("deps", "libxft")
end
end)
on_install("windows", "macosx", "linux", function (package)
os.cp(path.join(os.scriptdir(), "port", "xmake.lua"), "xmake.lua")
import("package.tools.xmake").install(package)
import("package.tools.xmake").install(package, {tools = package:config("tools")})
if package:config("tools") then
package:addenv("PATH", "bin")
end
end)
on_test(function (package)

Loading…
Cancel
Save