diff --git a/packages/s/scope_guard/xmake.lua b/packages/n/neargye-scope_guard/xmake.lua similarity index 95% rename from packages/s/scope_guard/xmake.lua rename to packages/n/neargye-scope_guard/xmake.lua index 36fd4d458..cf7f559d3 100644 --- a/packages/s/scope_guard/xmake.lua +++ b/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++") diff --git a/packages/r/ricab-scope_guard/xmake.lua b/packages/r/ricab-scope_guard/xmake.lua new file mode 100644 index 000000000..0e282aa6e --- /dev/null +++ b/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 + void my_callback() {} + void test() { + auto guard = sg::make_scope_guard(my_callback); + } + ]]}, {configs = {languages = "c++11"}})) + end)