xmake.lua 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package("sfgui")
  2. set_homepage("https://github.com/TankOs/SFGUI")
  3. set_description("Simple and Fast Graphical User Interface")
  4. set_license("zlib")
  5. add_urls("https://github.com/TankOs/SFGUI/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/TankOs/SFGUI.git")
  7. add_versions("1.0.0", "280993756cfa8ca82574a5c505f4ce65f192037d523d38572552e96ca18aa3a0")
  8. add_configs("font", {description = "Include default font in library (DejaVuSans)", default = true, type = "boolean"})
  9. if is_plat("mingw") then
  10. add_deps("sfml", {configs = {graphics = true, shared = true}})
  11. else
  12. add_deps("sfml", {configs = {graphics = true}})
  13. end
  14. add_deps("opengl")
  15. if is_plat("linux", "bsd", "cross") then
  16. add_deps("libx11")
  17. end
  18. if is_plat("macosx", "iphoneos") then
  19. add_frameworks("CoreFoundation", "Foundation")
  20. end
  21. on_install("windows", "linux", "macosx", "mingw", function (package)
  22. io.replace("include/SFGUI/Config.hpp", "!defined( SFGUI_STATIC )", not package:config("shared") and "0" or "1", {plain = true})
  23. os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
  24. import("package.tools.xmake").install(package)
  25. end)
  26. on_test(function (package)
  27. assert(package:check_cxxsnippets({test = [[
  28. void test() {
  29. sfg::Window::Ptr window = sfg::Window::Create();
  30. window->SetTitle( "Title" );
  31. }
  32. ]]}, {configs = {languages = "c++17"}, includes = { "SFGUI/SFGUI.hpp", "SFGUI/Widgets.hpp" } }))
  33. end)