xmake.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. package("fls-float-raylib")
  2. set_base("raylib")
  3. on_install("windows", "mingw", function (package)
  4. local renaming_rules = {
  5. { "ShowCursor(", "rlShowCursor(" },
  6. { "HideCursor(", "rlHideCursor(" },
  7. { "PlaySound(", "rlPlaySound(" },
  8. { "StopSound(", "rlStopSound(" },
  9. { "(Rectangle)", "(rlRectangle)" },
  10. { "Rectangle{", "rlRectangle{" },
  11. { "Rectangle;", "rlRectangle;" },
  12. { "Rectangle ", "rlRectangle " },
  13. { "CloseWindow(", "rlCloseWindow(" },
  14. { "LoadImage(", "rlLoadImage(" },
  15. { "DrawText(", "rlDrawText(" },
  16. { "DrawTextEx(", "rlDrawTextEx(" },
  17. }
  18. for _, file in ipairs(table.join(os.files("src/**.c"), os.files("src/**.h"))) do
  19. for _, rule in ipairs(renaming_rules) do
  20. io.replace(file, rule[1], rule[2], {plain = true})
  21. end
  22. end
  23. package:base():script("install")(package)
  24. end)
  25. on_test(function (package)
  26. assert(package:check_cxxsnippets({test = [[
  27. void test() {
  28. Image image = rlLoadImage("image.png");
  29. }
  30. ]]}, {includes = {"raylib.h"}, configs = {languages = "cxx11"}}))
  31. end)