2
0

xmake.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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.2", "dc86beed1dd9b0e7a8524b434e46a9a53c414303aa5276a7fbaf3d0392735647")
  8. add_versions("v1.3.1", "3e060d3376fdfd9cd092e324f5d50dde9632e9f544295f4613c8e22078653ff0")
  9. add_versions("v1.3.0", "998bd82fb2f49ee4b0df98774424d72c2bc18225188f251a9242af28bb80e6d4")
  10. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  11. on_install("windows", function (package)
  12. io.writefile("xmake.lua", [[
  13. add_rules("mode.debug", "mode.release")
  14. set_languages("c++11")
  15. target("wintoast")
  16. set_kind("$(kind)")
  17. add_headerfiles("include/(wintoastlib.h)")
  18. add_files("src/wintoastlib.cpp")
  19. add_includedirs("include")
  20. ]])
  21. import("package.tools.xmake").install(package)
  22. end)
  23. on_test(function (package)
  24. assert(package:check_cxxsnippets({test = [[
  25. #include "wintoastlib.h"
  26. using namespace WinToastLib;
  27. void test() {
  28. if (WinToast::isCompatible()) {
  29. WinToastTemplate templ = WinToastTemplate(WinToastTemplate::Text01);
  30. templ.setTextField(L"Hello World", WinToastTemplate::FirstLine);
  31. } else {
  32. std::cout << "Error, your system in not supported!" << std::endl;
  33. }
  34. }
  35. ]]}, {configs = {languages = "c++11"}}))
  36. end)