xmake.lua 3.3 KB

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