2
0

xmake.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package("crashpad")
  2. set_homepage("https://chromium.googlesource.com/crashpad/crashpad/+/refs/heads/main/README.md")
  3. set_description("Crashpad is a crash-reporting system.")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/getsentry/crashpad.git")
  6. add_versions("2025.09.18", "79a91fe62324c9c17c8ec1b8508778228ba955a7")
  7. add_includedirs("include/crashpad", "include/crashpad/mini_chromium")
  8. add_links("crashpad_client", "crashpad_util", "mini_chromium")
  9. if add_bindirs then
  10. add_bindirs("bin")
  11. end
  12. add_deps("cmake")
  13. add_deps("libcurl")
  14. if is_plat("macosx") then
  15. add_frameworks("CoreFoundation")
  16. add_syslinks("bsm")
  17. end
  18. if is_plat("windows") then
  19. add_defines("NOMINMAX", "WIN32_LEAN_AND_MEAN")
  20. end
  21. on_install("linux", "windows|x64", "windows|x86", "macosx", function(package)
  22. local configs = {}
  23. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  24. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  25. import("package.tools.cmake").install(package, configs, {packagedeps = "libcurl"})
  26. if not package:get("bindirs") then
  27. package:addenv("PATH", "bin")
  28. end
  29. end)
  30. on_test(function(package)
  31. if not package:is_cross() then
  32. os.vrun("crashpad_handler --help")
  33. end
  34. assert(package:check_cxxsnippets({test = [[
  35. #include "client/crashpad_client.h"
  36. using namespace crashpad;
  37. void test() {
  38. CrashpadClient *client = new CrashpadClient();
  39. }
  40. ]]}, {configs = {languages = "cxx20"}}))
  41. end)