xmake.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package("stackwalker")
  2. set_homepage("https://github.com/JochenKalmbach/StackWalker")
  3. set_description("A library to walk the callstack in windows applications.")
  4. set_urls("https://github.com/JochenKalmbach/StackWalker/archive/$(version).zip",
  5. "https://github.com/JochenKalmbach/StackWalker.git")
  6. add_versions("1.20", "b139c83b7c4991930ebe48eae43b0feedca034e136f00be294f3641495b2c835")
  7. add_patches("1.20", path.join(os.scriptdir(), "patches", "1.20", "debug_build.patch"), "dcd455d9c3560bcc7793e7c2f0ffafd363f26754ae87091fb982fffcff298466")
  8. add_deps("cmake")
  9. if is_plat("windows") then
  10. add_syslinks("advapi32")
  11. end
  12. on_install("windows", function (package)
  13. local configs = {"-DStackWalker_DISABLE_TESTS=ON"}
  14. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  15. import("package.tools.cmake").install(package, configs)
  16. end)
  17. on_test(function (package)
  18. assert(package:check_cxxsnippets({test = [[
  19. void Func5() { StackWalker sw; sw.ShowCallstack(); }
  20. void Func4() { Func5(); }
  21. void Func3() { Func4(); }
  22. void Func2() { Func3(); }
  23. void Func1() { Func2(); }
  24. void test() {
  25. Func1();
  26. }
  27. ]]}, {includes = {"StackWalker.h"}}))
  28. end)