xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728
  1. package("jthread")
  2. set_homepage("https://github.com/j0r1/JThread")
  3. set_description("The JThread package provides some classes to make use of threads easy on different platforms")
  4. set_license("MIT")
  5. add_urls("https://github.com/j0r1/JThread.git")
  6. add_versions("2023.08.18", "719413043807b77448df3ba1c749798fb72ee459")
  7. add_patches("2023.08.18", "patches/2023.08.18/cmakelist.patch", "62304c64bf7a84ce7d3f95042d2307b4306d934e00cc033837610d9cef8401d5")
  8. add_deps("cmake")
  9. add_includedirs("include", "include/jthread")
  10. on_install(function(package)
  11. local configs = {"-DCMAKE_POLICY_DEFAULT_CMP0057=NEW"}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DJTHREAD_COMPILE_STATIC=" .. (package:config("shared") and "OFF" or "ON"))
  14. import("package.tools.cmake").install(package, configs)
  15. end)
  16. on_test(function (package)
  17. assert(package:check_cxxsnippets({test = [[
  18. using namespace jthread;
  19. JMutex* test = new JMutex();
  20. ]]}, {configs = {languages = "c++11"}, includes = "jthread.h"}))
  21. end)