Browse Source

add stduuid (#2919)

Co-authored-by: Your Name <[email protected]>
xpxz 1 year ago
parent
commit
d9f19a1d86
1 changed files with 27 additions and 0 deletions
  1. 27 0
      packages/s/stduuid/xmake.lua

+ 27 - 0
packages/s/stduuid/xmake.lua

@@ -0,0 +1,27 @@
+package("stduuid")
+    set_kind("library")
+    set_homepage("https://github.com/mariusbancila/stduuid")
+    set_description("A C++17 cross-platform implementation for UUIDs")
+    set_license("MIT")
+
+    add_urls("https://github.com/mariusbancila/stduuid/archive/refs/tags/v$(version).zip")
+    add_versions("1.2.3", "0f867768ce55f2d8fa361be82f87f0ea5e51438bc47ca30cd92c9fd8b014e84e")
+
+    add_deps("cmake")
+
+    on_install(function (package)
+        local configs = {}
+        table.insert(configs, "-DUUID_BUILD_TESTS=OFF")
+        table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
+        import("package.tools.cmake").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include "uuid.h"
+            using namespace uuids;
+            void test() {
+                uuid empty;
+            }
+        ]]}, {configs = {languages = "c++17"}}))
+    end)