xmake.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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.0", "9110638e21ef02428254af8688bf9e766483db8cc2624144aa3c59006907ce22")
  8. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  9. on_install(function (package)
  10. io.writefile("xmake.lua", [[
  11. add_rules("mode.debug", "mode.release")
  12. target("easyloggingpp")
  13. set_kind("static")
  14. set_languages("c++11")
  15. add_files("src/easylogging++.cc")
  16. add_headerfiles("src/easylogging++.h")
  17. ]])
  18. import("package.tools.xmake").install(package)
  19. end)
  20. on_test(function (package)
  21. assert(package:check_cxxsnippets({test = [[
  22. INITIALIZE_EASYLOGGINGPP
  23. void test() {
  24. LOG(INFO) << "My first info log using default logger";
  25. }
  26. ]]}, {configs = {languages = "c++11"}, includes = "easylogging++.h"}))
  27. end)