2
0

xmake.lua 1.2 KB

1234567891011121314151617181920212223242526272829
  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_versions("2023.07.23", "76a2024e132bcc83bec1ecfebeacd5d20d490bfe")
  7. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  8. on_install(function (package)
  9. io.writefile("xmake.lua", [[
  10. add_rules("mode.debug", "mode.release")
  11. target("pystring")
  12. set_kind("static")
  13. add_files("pystring.cpp")
  14. add_headerfiles("pystring.h", {prefixdir = "pystring"})
  15. ]])
  16. import("package.tools.xmake").install(package)
  17. end)
  18. on_test(function (package)
  19. assert(package:check_cxxsnippets({test = [[
  20. void test() {
  21. bool res = pystring::endswith("abcdef", "cdef");
  22. }
  23. ]]}, {configs = {languages = "c++11"}, includes = "pystring/pystring.h"}))
  24. end)