xmake.lua 1.2 KB

123456789101112131415161718192021222324252627282930
  1. package("cpptrace")
  2. set_homepage("https://github.com/jeremy-rifkin/cpptrace")
  3. set_description("Lightweight, zero-configuration-required, and cross-platform stacktrace library for C++")
  4. set_license("MIT")
  5. add_urls("https://github.com/jeremy-rifkin/cpptrace/-/archive/$(version).tar.gz",
  6. "https://github.com/jeremy-rifkin/cpptrace.git")
  7. add_versions("v0.1", "411bf19e079b550c50e6d39c82e3cb8d4a7dd2e9a8107a8f1843929c4b4e63de")
  8. add_deps("cmake")
  9. if is_plat("windows") then
  10. add_syslinks("dbghelp")
  11. end
  12. on_install("linux", "macosx", "windows", function (package)
  13. local configs = {}
  14. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  15. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  16. import("package.tools.cmake").install(package, configs)
  17. end)
  18. on_test(function (package)
  19. assert(package:check_cxxsnippets({test = [[
  20. void test() {
  21. cpptrace::print_trace();
  22. }
  23. ]]}, {configs = {languages = "c++11"}, includes = {"cpptrace/cpptrace.hpp"}}))
  24. end)