2
0

xmake.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package("wintoast")
  2. set_homepage("https://github.com/mohabouje/WinToast")
  3. set_description("WinToast is a lightly library written in C++ which brings a complete integration of the modern toast notifications of Windows 8, Windows 10 and Windows 11.")
  4. set_license("MIT")
  5. add_urls("https://github.com/mohabouje/WinToast/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/mohabouje/WinToast.git")
  7. add_versions("v1.3.0", "998bd82fb2f49ee4b0df98774424d72c2bc18225188f251a9242af28bb80e6d4")
  8. on_install("windows", function (package)
  9. io.writefile("xmake.lua", [[
  10. add_rules("mode.debug", "mode.release")
  11. set_languages("c++11")
  12. target("wintoast")
  13. set_kind("$(kind)")
  14. add_headerfiles("include/(wintoastlib.h)")
  15. add_files("src/wintoastlib.cpp")
  16. add_includedirs("include")
  17. if not is_mode("debug") then
  18. add_defines("NDEBUG")
  19. end
  20. ]])
  21. local configs = {}
  22. import("package.tools.xmake").install(package, configs)
  23. end)
  24. on_test(function (package)
  25. assert(package:check_cxxsnippets({test = [[
  26. #include "wintoastlib.h"
  27. using namespace WinToastLib;
  28. void test() {
  29. if (WinToast::isCompatible()) {
  30. WinToastTemplate templ = WinToastTemplate(WinToastTemplate::Text01);
  31. templ.setTextField(L"Hello World", WinToastTemplate::FirstLine);
  32. } else {
  33. std::cout << "Error, your system in not supported!" << std::endl;
  34. }
  35. }
  36. ]]}, {configs = {languages = "c++11"}}))
  37. end)