2
0

xmake.lua 1.0 KB

1234567891011121314151617181920212223242526272829
  1. package("cpp-async")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/microsoft/cpp-async")
  4. set_description("Support types and functions for C++20 coroutines")
  5. set_license("MIT")
  6. add_urls("https://github.com/microsoft/cpp-async/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/microsoft/cpp-async.git")
  8. add_versions("v1.1.0", "168681dfd999b7546d623f20d18072ce280502cf0bf3a829c2aec58741062a23")
  9. on_check(function (package)
  10. assert(package:has_cxxincludes("coroutine", {configs = {languages = "c++20"}}), "package(cpp-async) Require at least C++20.")
  11. end)
  12. on_install(function (package)
  13. os.cp("include/async", package:installdir("include"))
  14. end)
  15. on_test(function (package)
  16. assert(package:check_cxxsnippets({test = [[
  17. #include <async/task.h>
  18. #include <coroutine>
  19. inline async::task<void> do_async()
  20. {
  21. co_return;
  22. }
  23. ]]}, {configs = {languages = "c++20"}}))
  24. end)