xmake.lua 1.1 KB

1234567891011121314151617181920212223242526
  1. package("thread-pool")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/bshoshany/thread-pool")
  4. set_description("BS::thread_pool: a fast, lightweight, and easy-to-use C++17 thread pool library")
  5. set_license("MIT")
  6. add_urls("https://github.com/bshoshany/thread-pool/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/bshoshany/thread-pool.git")
  8. add_versions("v3.3.0", "b76c0103c7ed07c137bd5b1988b9c09da280bbbad37588a096d2954c8d996e0f")
  9. on_install(function (package)
  10. os.cp("BS_thread_pool.hpp", package:installdir("include"))
  11. end)
  12. on_test(function (package)
  13. assert(package:check_cxxsnippets({
  14. test = [[
  15. #include <BS_thread_pool.hpp>
  16. static void test() {
  17. BS::thread_pool pool;
  18. std::future<int> my_future = pool.submit([] { return 42; });
  19. std::cout << my_future.get();
  20. }
  21. ]]
  22. }, {configs = {languages = "c++17"}, includes = {"BS_thread_pool.hpp"}}))
  23. end)