From f43a855c9479c9d719e3a671c818975fa8b70990 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 25 Dec 2021 22:45:52 +0800 Subject: [PATCH] Create xmake.lua (#794) --- packages/l/libsigc++/xmake.lua | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 packages/l/libsigc++/xmake.lua diff --git a/packages/l/libsigc++/xmake.lua b/packages/l/libsigc++/xmake.lua new file mode 100644 index 000000000..d81fa97b5 --- /dev/null +++ b/packages/l/libsigc++/xmake.lua @@ -0,0 +1,39 @@ +package("libsigc++") + + set_homepage("https://libsigcplusplus.github.io/libsigcplusplus") + set_description("Callback framework for C++") + set_license("LGPL-3.0-or-later") + + add_urls("https://download.gnome.org/sources/libsigc++/$(version).tar.xz", {version = function (version) + return version:major() .. "." .. version:minor() .. "/libsigc++-" .. version + end}) + add_versions("3.0.7", "bfbe91c0d094ea6bbc6cbd3909b7d98c6561eea8b6d9c0c25add906a6e83d733") + + add_deps("meson", "ninja") + if is_plat("linux") then + add_deps("m4") + end + + add_includedirs("include/sigc++-3.0", "lib/sigc++-3.0/include") + + on_install("macosx", "linux", function (package) + local configs = {"-Dbuild-examples=false"} + table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) + import("package.tools.meson").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + #include + void on_print(const std::string& str) { + std::cout << str; + } + void test() { + sigc::signal signal_print; + signal_print.connect(sigc::ptr_fun(&on_print)); + signal_print.emit("hello world\\n"); + } + ]]}, {configs = {languages = "c++17"}})) + end)