xmake.lua 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package("fls-float-rlimgui")
  2. set_homepage("https://github.com/raylib-extras/rlImGui")
  3. set_description("A Custom Raylib build integration with DearImGui for floatengine")
  4. set_license("zlib")
  5. add_urls("https://github.com/raylib-extras/rlImGui.git")
  6. add_versions("2025.11.27", "dc7f97679a024eee8f5f009e77cc311748200415")
  7. if is_plat("windows") then
  8. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  9. end
  10. add_deps("fls-float-raylib")
  11. add_deps("imgui v1.92.5-docking", {configs = {wchar32 = true}})
  12. on_install("windows", "mingw", function (package)
  13. local renaming_rules = {
  14. { "ShowCursor(", "rlShowCursor(" },
  15. { "HideCursor(", "rlHideCursor(" },
  16. { "PlaySound(", "rlPlaySound(" },
  17. { "StopSound(", "rlStopSound(" },
  18. { "(Rectangle)", "(rlRectangle)" },
  19. { "Rectangle{", "rlRectangle{" },
  20. { "Rectangle;", "rlRectangle;" },
  21. { "Rectangle ", "rlRectangle " },
  22. { "CloseWindow(", "rlCloseWindow(" },
  23. { "LoadImage(", "rlLoadImage(" },
  24. { "DrawText(", "rlDrawText(" },
  25. { "DrawTextEx(", "rlDrawTextEx(" },
  26. }
  27. for _, file in ipairs(table.join(os.files("**.cpp"), os.files("**.h"))) do
  28. for _, rule in ipairs(renaming_rules) do
  29. io.replace(file, rule[1], rule[2], {plain = true})
  30. end
  31. end
  32. io.writefile("xmake.lua", [[
  33. add_rules("mode.debug", "mode.release")
  34. set_languages("c99", "c++17")
  35. add_requires("fls-float-raylib")
  36. add_requires("imgui v1.92.5-docking", {configs = {wchar32 = true}})
  37. if is_plat("linux") then
  38. add_defines("_GLFW_X11", "_GNU_SOURCE")
  39. end
  40. target("rlImGui")
  41. set_kind("$(kind)")
  42. add_files("*.cpp")
  43. add_headerfiles("*.h", "(extras/**.h)")
  44. add_includedirs(".", {public = true})
  45. add_packages("fls-float-raylib", "imgui")
  46. add_defines("IMGUI_DISABLE_OBSOLETE_FUNCTIONS", "IMGUI_DISABLE_OBSOLETE_KEYIO")
  47. ]])
  48. import("package.tools.xmake").install(package)
  49. end)
  50. on_test(function (package)
  51. assert(package:check_cxxsnippets({test = [[
  52. void test() {
  53. rlImGuiBegin();
  54. }
  55. ]]}, {includes = {"rlImGui.h"}, configs = {languages = "c++17"}}))
  56. end)