Bläddra i källkod

update raygui (#1520)

* update raygui

* add config
ruki 2 år sedan
förälder
incheckning
f77bc69421
1 ändrade filer med 14 tillägg och 3 borttagningar
  1. 14 3
      packages/r/raygui/xmake.lua

+ 14 - 3
packages/r/raygui/xmake.lua

@@ -7,21 +7,32 @@ package("raygui")
     add_urls("https://github.com/raysan5/raygui/archive/refs/tags/$(version).tar.gz",
     add_urls("https://github.com/raysan5/raygui/archive/refs/tags/$(version).tar.gz",
              "https://github.com/raysan5/raygui.git")
              "https://github.com/raysan5/raygui.git")
     add_versions("3.0", "a510eb6efb524dfc8a1a7072bab3d4182a550f9fe86d315ff13a59cfc707f877")
     add_versions("3.0", "a510eb6efb524dfc8a1a7072bab3d4182a550f9fe86d315ff13a59cfc707f877")
+    add_versions("3.2", "23fb86a0c5fd8216e31c396c5f42de5f11c71f940078fb7d65aa1c39f3895c79")
 
 
     add_deps("raylib 4.x")
     add_deps("raylib 4.x")
 
 
-    add_defines("RAYGUI_IMPLEMENTATION")
+    add_configs("implemention", { description = "Define implemention.", default = false, type = "boolean"})
+
+    on_load(function (package)
+        if package:config("implemention") then
+            package:add("defines", "RAYGUI_IMPLEMENTATION")
+        end
+    end)
 
 
     on_install("windows", "linux", "macosx", function (package)
     on_install("windows", "linux", "macosx", function (package)
         os.cp("src/*", package:installdir("include"))
         os.cp("src/*", package:installdir("include"))
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)
+        local defines
+        if not package:config("implemention") then
+            defines = "RAYGUI_IMPLEMENTATION"
+        end
         assert(package:check_csnippets({test = [[
         assert(package:check_csnippets({test = [[
             #include <raygui.h>
             #include <raygui.h>
             void test() {
             void test() {
                 InitWindow(100, 100, "hello world!");
                 InitWindow(100, 100, "hello world!");
-                GuiSetStyle(TEXTBOX, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER);
+                GuiSetStyle(TEXTBOX, 0, 0);
             }
             }
-        ]]}))
+        ]]}, {configs = {defines = defines}}))
     end)
     end)