xmake.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  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_license("BSD-2-Clause")
  5. set_urls("https://github.com/JochenKalmbach/StackWalker/archive/$(version).zip",
  6. "https://github.com/JochenKalmbach/StackWalker.git")
  7. add_versions("1.20", "b139c83b7c4991930ebe48eae43b0feedca034e136f00be294f3641495b2c835")
  8. add_patches("1.20", path.join(os.scriptdir(), "patches", "1.20", "debug_build.patch"), "dcd455d9c3560bcc7793e7c2f0ffafd363f26754ae87091fb982fffcff298466")
  9. add_deps("cmake")
  10. if is_plat("windows") then
  11. add_syslinks("advapi32")
  12. end
  13. on_install("windows", function (package)
  14. local configs = {"-DStackWalker_DISABLE_TESTS=ON"}
  15. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  16. import("package.tools.cmake").install(package, configs)
  17. end)
  18. on_test(function (package)
  19. assert(package:check_cxxsnippets({test = [[
  20. void Func5() { StackWalker sw; sw.ShowCallstack(); }
  21. void Func4() { Func5(); }
  22. void Func3() { Func4(); }
  23. void Func2() { Func3(); }
  24. void Func1() { Func2(); }
  25. void test() {
  26. Func1();
  27. }
  28. ]]}, {includes = {"StackWalker.h"}}))
  29. end)