xmake.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package("ultralight")
  2. set_homepage("https://ultralig.ht")
  3. set_description("Ultralight makes it easy for C/C++ developers to seamlessly integrate web-content into games and desktop apps.")
  4. set_license("LGPL")
  5. if is_plat("windows") then
  6. add_urls("https://github.com/ultralight-ux/Ultralight/releases/download/v1.3.0/ultralight-sdk-1.3.0-win-x64.7z")
  7. add_versions("1.3.0", "cc8bfc66a4c40c88fa02691febe6f21c248a2a30d17cfe5470fccc3a461ce49e")
  8. elseif is_plat("linux") then
  9. add_urls("https://github.com/ultralight-ux/Ultralight/releases/download/v1.3.0/ultralight-sdk-1.3.0-linux-x64.7z")
  10. add_versions("1.3.0", "1de6298b5ed3c5e0c22ac27e0e30fcb0ba6d195467a58ee44ef4e13dd1a6d352")
  11. elseif is_plat("macosx") then
  12. add_urls("https://github.com/ultralight-ux/Ultralight/releases/download/v1.3.0/ultralight-sdk-1.3.0-mac-x64.7z")
  13. add_versions("1.3.0", "bbf81ed456a617a60a19e9a76946e4479d5bac877f859005c50f66e9ec3c77a2")
  14. end
  15. add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true})
  16. on_install("windows|x64", "linux|x86_64", "macosx|x86_64", function (package)
  17. if package:is_plat("linux") then
  18. if linuxos.name() ~= "ubuntu" and linuxos.name() ~= "debian" or (linuxos.version():major() < 9 and linuxos.version():minor() < 5) then
  19. print("Ultralight is officially supported on Ubuntu/Debian 9.5+. use it at your own risks")
  20. end
  21. end
  22. os.cp("include", package:installdir())
  23. os.trycp("lib", package:installdir())
  24. os.trycp("bin", package:installdir())
  25. end)
  26. on_test(function (package)
  27. assert(package:check_cxxsnippets({test = [[
  28. #include <AppCore/App.h>
  29. #include <Ultralight/platform/Platform.h>
  30. void test()
  31. {
  32. auto app = ultralight::App::Create();
  33. }
  34. ]]}, {configs = {languages = "c++17"}}))
  35. end)