2
0

xmake.lua 1.3 KB

12345678910111213141516171819202122232425262728293031
  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. set_license("BSD-3-Clause")
  5. add_urls("https://github.com/imageworks/pystring.git")
  6. add_versions("2020.02.04", "281419de2f91f9e0f2df6acddfea3b06a43436be")
  7. add_versions("2023.07.23", "76a2024e132bcc83bec1ecfebeacd5d20d490bfe")
  8. add_versions("2025.06.23", "02ef1186d6b77bc35f385bd4db2da75b4736adb7")
  9. on_install(function (package)
  10. io.writefile("xmake.lua", [[
  11. add_rules("mode.debug", "mode.release")
  12. target("pystring")
  13. set_kind("$(kind)")
  14. add_files("pystring.cpp")
  15. add_headerfiles("pystring.h", {prefixdir = "pystring"})
  16. if is_plat("windows") and is_kind("shared") then
  17. add_rules("utils.symbols.export_all", {export_classes = true})
  18. end
  19. ]])
  20. import("package.tools.xmake").install(package)
  21. end)
  22. on_test(function (package)
  23. assert(package:check_cxxsnippets({test = [[
  24. void test() {
  25. bool res = pystring::endswith("abcdef", "cdef");
  26. }
  27. ]]}, {configs = {languages = "c++11"}, includes = "pystring/pystring.h"}))
  28. end)