xmake.lua 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. package("ode")
  2. set_homepage("http://ode.org/")
  3. set_description("ODE is an open source, high performance library for simulating rigid body dynamics.")
  4. set_license("BSD-3-Clause")
  5. add_urls("https://bitbucket.org/odedevs/ode/get/$(version).zip")
  6. add_versions("0.16.2", "000a5cdd0a81811cade2b0409ec06911a95e3c4c0d72a4cce3af6131115d0350")
  7. add_configs("libccd", {description = "Build with libccd.", default = false, type = "boolean"})
  8. add_deps("cmake")
  9. if is_plat("windows") then
  10. add_syslinks("user32")
  11. elseif is_plat("linux") then
  12. add_syslinks("pthread")
  13. end
  14. on_install("windows", "macosx", "linux", function (package)
  15. local configs = {"-DODE_WITH_DEMOS=OFF", "-DODE_WITH_TESTS=OFF"}
  16. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  17. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  18. if package:config("libccd") then
  19. table.insert(configs, "-DODE_WITH_LIBCCD=ON")
  20. end
  21. import("package.tools.cmake").install(package, configs)
  22. end)
  23. on_test(function (package)
  24. assert(package:has_cfuncs("dInitODE", {includes = "ode/odeinit.h"}))
  25. end)