xmake.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  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("v5.0.0", "617a8fbc2c360577f498998f336777c73d581810831d4ce9c920f11ec680b07b")
  9. add_versions("v4.1.0", "be7abecbc420bb87919eeef729b13ff7c29d5ce547bdae284923296c695415bd")
  10. add_versions("v3.3.0", "b76c0103c7ed07c137bd5b1988b9c09da280bbbad37588a096d2954c8d996e0f")
  11. if on_check then
  12. on_check("bsd", function (package)
  13. if package:version() and package:version():ge("5.0.0") then
  14. raise("package(thread-pool) unsupported platform")
  15. end
  16. end)
  17. end
  18. on_install(function (package)
  19. if package:version() and package:version():ge("3.5.0") then
  20. os.vcp("include", package:installdir())
  21. else
  22. os.vcp("BS_thread_pool.hpp", package:installdir("include"))
  23. end
  24. end)
  25. on_test(function (package)
  26. assert(package:check_cxxsnippets({test = [[
  27. void test() {
  28. BS::thread_pool pool;
  29. }
  30. ]]}, {configs = {languages = "c++17"}, includes = "BS_thread_pool.hpp"}))
  31. end)