xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728
  1. package("pystring")
  2. set_homepage("https://github.com/imageworks/pystring")
  3. set_description("Pystring is a collection of C++ functions which match the interface and behavior of python's string class methods using std::string.")
  4. add_urls("https://github.com/imageworks/pystring.git")
  5. add_versions("2020.02.04", "281419de2f91f9e0f2df6acddfea3b06a43436be")
  6. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  7. on_install(function (package)
  8. io.writefile("xmake.lua", [[
  9. add_rules("mode.debug", "mode.release")
  10. target("pystring")
  11. set_kind("static")
  12. add_files("pystring.cpp")
  13. add_headerfiles("pystring.h", {prefixdir = "pystring"})
  14. ]])
  15. import("package.tools.xmake").install(package)
  16. end)
  17. on_test(function (package)
  18. assert(package:check_cxxsnippets({test = [[
  19. void test() {
  20. bool res = pystring::endswith("abcdef", "cdef");
  21. }
  22. ]]}, {configs = {languages = "c++11"}, includes = "pystring/pystring.h"}))
  23. end)