xmake.lua 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. package("polyclipping")
  2. set_homepage("https://sourceforge.net/projects/polyclipping")
  3. set_description("Polygon and line clipping and offsetting library")
  4. set_license("BSL-1.0")
  5. add_urls("https://sourceforge.net/projects/polyclipping/files/clipper_ver$(version).zip")
  6. add_versions("6.4.2", "a14320d82194807c4480ce59c98aa71cd4175a5156645c4e2b3edd330b930627")
  7. on_install(function (package)
  8. io.writefile("xmake.lua", [[
  9. add_rules("mode.release", "mode.debug")
  10. target("polyclipping")
  11. set_kind("$(kind)")
  12. set_languages("cxx11")
  13. add_files("cpp/*.cpp")
  14. add_headerfiles("cpp/(*.hpp)")
  15. if is_plat("windows") and is_kind("shared") then
  16. add_rules("utils.symbols.export_all", {export_classes = true})
  17. end
  18. ]])
  19. import("package.tools.xmake").install(package)
  20. end)
  21. on_test(function (package)
  22. assert(package:check_cxxsnippets({test = [[
  23. #include <clipper.hpp>
  24. void test() {
  25. ClipperLib::Clipper clipper;
  26. }
  27. ]]}, {configs = {languages = "cxx11"}}))
  28. end)