Bladeren bron

ricab-scope_guard: add package (#2698)

star9029 2 jaren geleden
bovenliggende
commit
27fa2ef7f0
2 gewijzigde bestanden met toevoegingen van 25 en 1 verwijderingen
  1. 1 1
      packages/n/neargye-scope_guard/xmake.lua
  2. 24 0
      packages/r/ricab-scope_guard/xmake.lua

+ 1 - 1
packages/s/scope_guard/xmake.lua → packages/n/neargye-scope_guard/xmake.lua

@@ -1,4 +1,4 @@
-package("scope_guard")
+package("neargye-scope_guard")
     set_kind("library", {headeronly = true})
     set_homepage("https://github.com/Neargye/scope_guard")
     set_description("Scope Guard & Defer C++")

+ 24 - 0
packages/r/ricab-scope_guard/xmake.lua

@@ -0,0 +1,24 @@
+package("ricab-scope_guard")
+    set_kind("library", {headeronly = true})
+    set_homepage("https://ricab.github.io/scope_guard/")
+    set_description("A modern C++ scope guard that is easy to use but hard to misuse.")
+    set_license("Unlicense")
+
+    add_urls("https://github.com/ricab/scope_guard/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/ricab/scope_guard.git")
+
+    add_versions("v1.1.0", "ddaf22ccd07e59af4698e2b9f912171adb664dc88f34b317f39dde3b88de4507")
+
+    on_install(function (package)
+        os.cp("scope_guard.hpp", package:installdir("include"))
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <scope_guard.hpp>
+            void my_callback() {}
+            void test() {
+                auto guard = sg::make_scope_guard(my_callback);
+            }
+        ]]}, {configs = {languages = "c++11"}}))
+    end)