xmake.lua 1.1 KB

123456789101112131415161718192021222324252627282930
  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("v325", "1f587ec0df6fd422dfe50f942f8836ac179b0723b768fe9d2fabdfd1601a0963")
  7. on_install(function (package)
  8. io.writefile("xmake.lua", [[
  9. add_rules("mode.debug", "mode.release")
  10. target("svm")
  11. set_kind("$(kind)")
  12. add_files("svm.cpp")
  13. add_headerfiles("svm.h")
  14. if is_kind("shared") then
  15. add_shflags("/DEF:svm.def")
  16. end
  17. ]])
  18. local configs = {}
  19. if package:config("shared") then
  20. configs.kind = "shared"
  21. end
  22. import("package.tools.xmake").install(package, configs)
  23. end)
  24. on_test(function (package)
  25. assert(package:has_cfuncs("svm_train", {includes = "svm.h"}))
  26. end)