xmake.lua 1010 B

12345678910111213141516171819202122
  1. package("fann")
  2. set_homepage("https://github.com/libfann/fann")
  3. set_description("Official github repository for Fast Artificial Neural Network Library (FANN)")
  4. set_license("LGPL-2.1")
  5. add_urls("https://github.com/libfann/fann.git")
  6. add_versions("2021.03.14", "a3cd24e528d6a865915a4fed6e8fac164ff8bfdc")
  7. add_deps("cmake")
  8. on_install("linux", "macosx", "windows", function (package)
  9. local configs = {}
  10. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  11. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  12. io.replace("CMakeLists.txt", "ADD_SUBDIRECTORY( tests )", "", {plain = true})
  13. io.replace("CMakeLists.txt", "ADD_SUBDIRECTORY( lib/googletest )", "", {plain = true})
  14. import("package.tools.cmake").install(package, configs)
  15. end)
  16. on_test(function (package)
  17. assert(package:has_cfuncs("fann_run", {includes = "floatfann.h"}))
  18. end)