xmake.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package("raygui")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/raysan5/raygui")
  4. set_description("A simple and easy-to-use immediate-mode gui library")
  5. set_license("zlib")
  6. add_urls("https://github.com/raysan5/raygui/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/raysan5/raygui.git")
  8. add_versions("3.0", "a510eb6efb524dfc8a1a7072bab3d4182a550f9fe86d315ff13a59cfc707f877")
  9. add_versions("3.2", "23fb86a0c5fd8216e31c396c5f42de5f11c71f940078fb7d65aa1c39f3895c79")
  10. add_versions("4.0", "299c8fcabda68309a60dc858741b76c32d7d0fc533cdc2539a55988cee236812")
  11. add_deps("raylib 5.x")
  12. add_configs("implemention", { description = "Define implemention.", default = false, type = "boolean"})
  13. on_load(function (package)
  14. if package:config("implemention") then
  15. package:add("defines", "RAYGUI_IMPLEMENTATION")
  16. end
  17. end)
  18. on_install("windows", "linux", "macosx", function (package)
  19. os.cp("src/*", package:installdir("include"))
  20. end)
  21. on_test(function (package)
  22. local defines
  23. if not package:config("implemention") then
  24. defines = "RAYGUI_IMPLEMENTATION"
  25. end
  26. assert(package:check_csnippets({test = [[
  27. #include <raygui.h>
  28. void test() {
  29. InitWindow(100, 100, "hello world!");
  30. GuiSetStyle(TEXTBOX, 0, 0);
  31. }
  32. ]]}, {configs = {defines = defines}}))
  33. end)