xmake.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. package("tinygltf")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://github.com/syoyo/tinygltf/")
  4. set_description("Header only C++11 tiny glTF 2.0 library")
  5. set_license("MIT")
  6. add_urls("https://github.com/syoyo/tinygltf/archive/refs/tags/$(version).tar.gz",
  7. "https://github.com/syoyo/tinygltf.git")
  8. add_versions("v2.5.0", "5d85bd556b60b1b69527189293cfa4902957d67fabb8582b6532f23a5ef27ec1")
  9. add_versions("v2.6.3", "f61e4a501baa7fbf31b18ea0f6815a59204ad0de281f7b04f0168f6bbd17c340")
  10. add_versions("v2.8.9", "cfff42b9246e1e24d36ec4ae94a22d5f4b0a1c63c796babb5c2a13fe66aed5e9")
  11. add_versions("v2.8.13", "72c3e5affa8389442582e4cf67426376e2dff418e998e19822260f4bf58b74b8")
  12. add_deps("cmake", "nlohmann_json", "stb")
  13. on_install(function (package)
  14. local configs = {
  15. "-DTINYGLTF_BUILD_LOADER_EXAMPLE=OFF",
  16. "-DTINYGLTF_HEADER_ONLY=ON"
  17. }
  18. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  19. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  20. import("package.tools.cmake").install(package, configs)
  21. end)
  22. on_test(function (package)
  23. assert(package:check_cxxsnippets({test = [[
  24. void test() {
  25. tinygltf::TinyGLTF loader;
  26. }
  27. ]]}, {configs = {languages = "c++14"}, includes = "tiny_gltf.h"}))
  28. end)