xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728
  1. package("universal_stacktrace")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/MisterTea/UniversalStacktrace")
  4. set_description("C++ Stacktrace for windows linux and os/x")
  5. set_license("Apache-2.0")
  6. add_urls("https://github.com/MisterTea/UniversalStacktrace.git", {submodules = false})
  7. add_versions("2022.11.06", "28f5230d75e677ce8e4e140b2f3e0b8550195c85")
  8. add_versions("2023.10.15", "88281dcc43c169afd5eea9fe26f68999656140e3")
  9. if is_plat("windows") then
  10. add_syslinks("dbghelp")
  11. end
  12. on_install("linux", "macosx", "windows", "mingw", function (package)
  13. io.replace("ust/ust.hpp", "#include <vector>", "#include <vector>\n#include <cstring>", {plain = true})
  14. io.replace("ust/ust.hpp", "#include <DbgHelp.h>\n#include <windows.h>", "#include <windows.h>\n#include <DbgHelp.h>", {plain = true})
  15. os.cp("ust", package:installdir("include"))
  16. end)
  17. on_test(function (package)
  18. assert(package:check_cxxsnippets({test = [[
  19. void test() {
  20. ust::generate();
  21. }
  22. ]]}, {includes = {"ust/ust.hpp"}}))
  23. end)