xmake.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. package("gelldur-eventbus")
  2. set_homepage("https://github.com/gelldur/EventBus")
  3. set_description("A lightweight and very fast event bus / event framework for C++17 ")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/gelldur/EventBus/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/gelldur/EventBus.git")
  7. add_versions("v3.1.2", "38e7fb003e875f5bddafd84c478f358007eff7224fafbf2143f9d27dad98e404")
  8. add_deps("cmake")
  9. on_install(function (package)
  10. io.replace("CMakeLists.txt", "add_subdirectory(use_case)", "", {plain = true})
  11. local configs = {"-DENABLE_TEST=OFF"}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  14. if package:config("shared") and package:is_plat("windows") then
  15. table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
  16. end
  17. import("package.tools.cmake").install(package, configs)
  18. end)
  19. on_test(function (package)
  20. assert(package:check_cxxsnippets({test = [[
  21. #include <memory>
  22. #include <dexode/EventBus.hpp>
  23. using EventBus = dexode::EventBus;
  24. void test() {
  25. auto eventBus = std::make_shared<EventBus>();
  26. }
  27. ]]}, {configs = {languages = "c++17"}}))
  28. end)