xmake.lua 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. package("libsvm")
  2. set_homepage("https://github.com/cjlin1/libsvm")
  3. set_description("A simple, easy-to-use, and efficient software for SVM classification and regression")
  4. add_urls("https://github.com/cjlin1/libsvm/archive/refs/tags/$(version).tar.gz",
  5. "https://github.com/cjlin1/libsvm.git")
  6. add_versions("v332", "e1d7d316112d199ebd69c9695f79226d236b86e2c8d88e70cfe35fd383954ed8")
  7. add_versions("v325", "1f587ec0df6fd422dfe50f942f8836ac179b0723b768fe9d2fabdfd1601a0963")
  8. on_install(function (package)
  9. io.writefile("xmake.lua", [[
  10. add_rules("mode.debug", "mode.release")
  11. target("svm")
  12. set_kind("$(kind)")
  13. add_files("svm.cpp")
  14. add_headerfiles("svm.h")
  15. if is_kind("shared") then
  16. add_shflags("/DEF:svm.def")
  17. end
  18. ]])
  19. local configs = {}
  20. if package:config("shared") then
  21. configs.kind = "shared"
  22. end
  23. import("package.tools.xmake").install(package, configs)
  24. end)
  25. on_test(function (package)
  26. assert(package:has_cfuncs("svm_train", {includes = "svm.h"}))
  27. end)