xmake.lua 1.2 KB

12345678910111213141516171819202122232425
  1. package("rocket")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/tripleslash/rocket")
  4. set_description("Fast single header signal/slots library for C++")
  5. add_urls("https://github.com/tripleslash/rocket/archive/348869fcda83f8b8b521c7654f83fea07ebe7a0a.tar.gz",
  6. "https://github.com/tripleslash/rocket.git")
  7. add_versions("2020.06.03", "de03b9c7f9b9478cfaa60683f95a7b0773dc0929d14e510c23f53b3804cc921f")
  8. on_install(function (package)
  9. io.replace("rocket.hpp", "return thread_id != std::thread::id{}", "return !(thread_id == std::thread::id{})", {plain = true})
  10. io.replace("rocket.hpp", "&& thread_id != std::this_thread::get_id();", "&& !(thread_id == std::this_thread::get_id());", {plain = true})
  11. os.cp("rocket.hpp", package:installdir("include"))
  12. end)
  13. on_test(function (package)
  14. assert(package:check_cxxsnippets({test = [[
  15. void test() {
  16. rocket::signal<void()> thread_unsafe_signal;
  17. rocket::thread_safe_signal<void()> thread_safe_signal;
  18. thread_unsafe_signal.connect([]() {});
  19. }
  20. ]]}, {configs = {languages = "c++17"}, includes = "rocket.hpp"}))
  21. end)