xmake.lua 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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.15.0", "2a995b921e4244c419f1c3a4dc4aa0805c0dc40fa32244a24cf64125e87161ae")
  8. add_versions("0.14.3", "1ab7d2fbf4c5a79aafac43cbd41ac9cff1e7f750248bee5141da5ee2d893cefe")
  9. add_versions("0.14.2", "52938e5a699b2c444dfeb2375facfbb7b1e3d405b424e361ad1a27391a53b89a")
  10. add_configs("fbx", {description = "Build Fbx pipeline (Requires Fbx SDK)", default = false, type = "boolean"})
  11. add_configs("gltf", {description = "Build glTF importer", default = false, type = "boolean"})
  12. add_configs("data", {description = "Build data on code change", default = false, type = "boolean"})
  13. add_configs("simd_ref", {description = "Force SIMD math reference implementation", default = false, type = "boolean"})
  14. add_configs("postfix", {description = "Use per config postfix name", default = false, type = "boolean"})
  15. add_deps("cmake")
  16. add_links("ozz_animation", "ozz_animation_offline", "ozz_geometry", "ozz_options", "ozz_base")
  17. on_install(function (package)
  18. if package:is_plat("windows") and package:is_arch("arm.*") then
  19. io.replace("build-utils/cmake/compiler_settings.cmake", "add_compile_options(/WX)", "", {plain = true})
  20. end
  21. local configs =
  22. {
  23. "-Dozz_build_tools=OFF",
  24. "-Dozz_build_samples=OFF",
  25. "-Dozz_build_tests=OFF",
  26. "-Dozz_build_howtos=OFF",
  27. "-Dozz_run_tests_headless=OFF",
  28. }
  29. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  30. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  31. if package:is_plat("windows") then
  32. table.insert(configs, "-Dozz_build_msvc_rt_dll=" .. (package:has_runtime("MD", "MDd") and "ON" or "OFF"))
  33. end
  34. for name, enabled in pairs(package:configs()) do
  35. if not package:extraconf("configs", name, "builtin") then
  36. table.insert(configs, "-Dozz_build_" .. name .. "=" .. (enabled and "ON" or "OFF"))
  37. end
  38. end
  39. import("package.tools.cmake").install(package, configs)
  40. end)
  41. on_test(function (package)
  42. assert(package:check_cxxsnippets({test = [[
  43. #include <ozz/animation/runtime/animation.h>
  44. void test() {
  45. auto x = ozz::animation::Animation();
  46. }
  47. ]]}, {configs = {languages = "c++11"}}))
  48. end)