Quellcode durchsuchen

microprofile: add package (#2740)

* microprofile: add package

* port

* disable plat

* fix bsd

* fix
star9029 vor 1 Jahr
Ursprung
Commit
285a625ca9
1 geänderte Dateien mit 44 neuen und 0 gelöschten Zeilen
  1. 44 0
      packages/m/microprofile/xmake.lua

+ 44 - 0
packages/m/microprofile/xmake.lua

@@ -0,0 +1,44 @@
+package("microprofile")
+    set_homepage("https://github.com/jonasmr/microprofile")
+    set_description("microprofile is an embeddable profiler")
+    set_license("Unlicense")
+
+    add_urls("https://github.com/jonasmr/microprofile/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/jonasmr/microprofile.git")
+
+    add_versions("v4.0", "59cd3ee7afd3ce5cfeb7599db62ccc0611818985a8e649353bec157122902a5c")
+
+    if is_plat("windows") then
+        add_syslinks("ws2_32", "advapi32", "shell32")
+        add_configs("shared", {description = "Build shared binaries.", default = false, type = "boolean", readonly = true})
+    elseif is_plat("linux", "bsd") then
+        add_syslinks("pthread")
+    end
+
+    add_deps("stb")
+
+    on_install("windows", "linux", "macosx", "bsd", "android", "iphoneos", function (package)
+        io.writefile("xmake.lua", [[
+            add_rules("mode.debug", "mode.release")
+            set_languages("c++11")
+            add_requires("stb")
+            target("microprofile")
+                set_kind("$(kind)")
+                add_files("microprofile.cpp")
+                add_headerfiles("microprofile.h", "microprofile_html.h")
+                if is_plat("windows") then
+                    add_syslinks("ws2_32", "advapi32", "shell32")
+                    if is_plat("windows") and is_kind("shared") then
+                        add_rules("utils.symbols.export_all", {export_classes = true})
+                    end
+                elseif is_plat("linux", "bsd") then
+                    add_syslinks("pthread")
+                end
+                add_packages("stb")
+        ]])
+        import("package.tools.xmake").install(package)
+    end)
+
+    on_test(function (package)
+        assert(package:has_cfuncs("MicroProfileFlip", {includes = "microprofile.h"}))
+    end)