xmake.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package("spine-runtimes")
  2. set_homepage("http://esotericsoftware.com")
  3. set_description("2D skeletal animation runtimes for Spine.")
  4. set_license("Spine Runtimes")
  5. add_urls("https://github.com/EsotericSoftware/spine-runtimes.git")
  6. add_versions("3.8", "d33c10f85634d01efbe4a3ab31dabaeaca41230c")
  7. add_patches("3.8", "patches/3.8/cmake.patch", "bbfa70e3e36f8b3beefbc84d8047eb6735e1e75f4dce643d8916e231b13b992c")
  8. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  9. if is_host("windows") then
  10. set_policy("platform.longpaths", true)
  11. end
  12. add_deps("cmake")
  13. on_install(function(package)
  14. local configs = {}
  15. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  16. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  17. import("package.tools.cmake").install(package, configs)
  18. end)
  19. on_test(function (package)
  20. assert(package:check_cxxsnippets({test = [[
  21. namespace spine {
  22. SpineExtension *getDefaultExtension() {
  23. return new DefaultSpineExtension();
  24. }
  25. }
  26. void test() {
  27. assert(spine::SpineExtension::getInstance() != nullptr);
  28. }
  29. ]]}, {configs = {languages = "c++17"}, includes = "spine/spine.h"}))
  30. end)