xmake.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. package("easyloggingpp")
  2. set_homepage("https://github.com/amrayn/easyloggingpp")
  3. set_description("Single header C++ logging library.")
  4. set_license("MIT")
  5. add_urls("https://github.com/amrayn/easyloggingpp/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/amrayn/easyloggingpp.git")
  7. add_versions("v9.97.1", "ebe473e17b13f1d1f16d0009689576625796947a711e14aec29530f39560c7c2")
  8. add_versions("v9.97.0", "9110638e21ef02428254af8688bf9e766483db8cc2624144aa3c59006907ce22")
  9. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  10. on_install(function (package)
  11. io.writefile("xmake.lua", [[
  12. add_rules("mode.debug", "mode.release")
  13. target("easyloggingpp")
  14. set_kind("static")
  15. set_languages("c++11")
  16. add_files("src/easylogging++.cc")
  17. add_headerfiles("src/easylogging++.h")
  18. ]])
  19. import("package.tools.xmake").install(package)
  20. end)
  21. on_test(function (package)
  22. assert(package:check_cxxsnippets({test = [[
  23. INITIALIZE_EASYLOGGINGPP
  24. void test() {
  25. LOG(INFO) << "My first info log using default logger";
  26. }
  27. ]]}, {configs = {languages = "c++11"}, includes = "easylogging++.h"}))
  28. end)