xmake.lua 1.1 KB

1234567891011121314151617181920212223242526272829
  1. package("rply")
  2. set_homepage("http://w3.impa.br/~diego/software/rply/")
  3. set_description("RPly is a library that lets applications read and write PLY files.")
  4. set_license("MIT")
  5. add_urls("http://w3.impa.br/~diego/software/rply/rply-$(version).tar.gz")
  6. add_versions("1.1.4", "daf0b060fe701adf72aab0d525323d2e2e1bde9aa6aa9713ff1a5ef1e768d703")
  7. on_install(function (package)
  8. io.writefile("xmake.lua", [[
  9. add_rules("mode.debug", "mode.release")
  10. target("rply")
  11. set_kind("$(kind)")
  12. add_files("rply.c")
  13. add_headerfiles("rply.h", "rplyfile.h")
  14. ]])
  15. local configs = {kind = "static"}
  16. if package:config("shared") then
  17. configs.kind = "shared"
  18. elseif package:is_plat("linux") and package:config("pic") ~= false then
  19. configs.cxflags = "-fPIC"
  20. end
  21. import("package.tools.xmake").install(package, configs)
  22. end)
  23. on_test(function (package)
  24. assert(package:has_cfuncs("ply_create", {includes = "rply.h"}))
  25. end)