xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728
  1. package("plutovg")
  2. set_homepage("https://github.com/sammycage/plutovg")
  3. set_description("Tiny 2D vector graphics library in C")
  4. set_license("MIT")
  5. add_urls("https://github.com/sammycage/plutovg/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/sammycage/plutovg.git")
  7. add_versions("v0.0.1", "32b8f3501e3964f288f277a607fa87b512466651")
  8. add_deps("cmake")
  9. on_load("windows", "mingw", function (package)
  10. if not package:config("shared") then
  11. package:add("defines", "PLUTOVG_BUILD_STATIC")
  12. end
  13. end)
  14. on_install(function (package)
  15. local configs = {"-DPLUTOVG_BUILD_EXAMPLES=OFF"}
  16. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  17. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  18. import("package.tools.cmake").install(package, configs)
  19. end)
  20. on_test(function (package)
  21. assert(package:has_cfuncs("plutovg_surface_create", {includes = "plutovg/plutovg.h"}))
  22. end)