2
0

xmake.lua 1.3 KB

123456789101112131415161718192021222324252627282930313233
  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. set_license("BSD-3-Clause")
  5. add_urls("https://github.com/cjlin1/libsvm/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/cjlin1/libsvm.git")
  7. add_versions("v333", "ee898ca11cef85b09e059b278b3ab4ff58cd38f70169829e75b4a3cb9ddc5013")
  8. add_versions("v332", "e1d7d316112d199ebd69c9695f79226d236b86e2c8d88e70cfe35fd383954ed8")
  9. add_versions("v325", "1f587ec0df6fd422dfe50f942f8836ac179b0723b768fe9d2fabdfd1601a0963")
  10. on_install(function (package)
  11. io.writefile("xmake.lua", [[
  12. add_rules("mode.debug", "mode.release")
  13. target("svm")
  14. set_kind("$(kind)")
  15. add_files("svm.cpp")
  16. add_headerfiles("svm.h")
  17. if is_kind("shared") then
  18. add_shflags("/DEF:svm.def")
  19. end
  20. ]])
  21. local configs = {}
  22. if package:config("shared") then
  23. configs.kind = "shared"
  24. end
  25. import("package.tools.xmake").install(package, configs)
  26. end)
  27. on_test(function (package)
  28. assert(package:has_cfuncs("svm_train", {includes = "svm.h"}))
  29. end)