xmake.lua 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package("ozz-animation")
  2. set_homepage("http://guillaumeblanc.github.io/ozz-animation/")
  3. set_description("Open source c++ skeletal animation library and toolset")
  4. set_license("MIT")
  5. add_urls("https://github.com/guillaumeblanc/ozz-animation/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/guillaumeblanc/ozz-animation.git")
  7. add_versions("0.14.3", "1ab7d2fbf4c5a79aafac43cbd41ac9cff1e7f750248bee5141da5ee2d893cefe")
  8. add_versions("0.14.2", "52938e5a699b2c444dfeb2375facfbb7b1e3d405b424e361ad1a27391a53b89a")
  9. add_configs("fbx", {description = "Build Fbx pipeline (Requires Fbx SDK)", default = false, type = "boolean"})
  10. add_configs("gltf", {description = "Build glTF importer", default = false, type = "boolean"})
  11. add_configs("data", {description = "Build data on code change", default = false, type = "boolean"})
  12. add_configs("simd_ref", {description = "Force SIMD math reference implementation", default = false, type = "boolean"})
  13. add_configs("postfix", {description = "Use per config postfix name", default = false, type = "boolean"})
  14. add_deps("cmake")
  15. add_links("ozz_animation", "ozz_animation_offline", "ozz_geometry", "ozz_options", "ozz_base")
  16. on_install(function (package)
  17. if package:is_plat("windows") and package:is_arch("arm.*") then
  18. io.replace("build-utils/cmake/compiler_settings.cmake", "add_compile_options(/WX)", "", {plain = true})
  19. end
  20. local configs =
  21. {
  22. "-Dozz_build_tools=OFF",
  23. "-Dozz_build_samples=OFF",
  24. "-Dozz_build_tests=OFF",
  25. "-Dozz_build_howtos=OFF",
  26. "-Dozz_run_tests_headless=OFF",
  27. }
  28. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  29. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  30. for name, enabled in pairs(package:configs()) do
  31. if not package:extraconf("configs", name, "builtin") then
  32. table.insert(configs, "-Dozz_build_" .. name .. "=" .. (enabled and "ON" or "OFF"))
  33. end
  34. end
  35. import("package.tools.cmake").install(package, configs)
  36. end)
  37. on_test(function (package)
  38. assert(package:check_cxxsnippets({test = [[
  39. #include <ozz/animation/runtime/animation.h>
  40. void test() {
  41. auto x = ozz::animation::Animation();
  42. }
  43. ]]}, {configs = {languages = "c++11"}}))
  44. end)