xmake.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("anari")
  2. set_homepage("https://github.com/KhronosGroup/ANARI-SDK")
  3. set_description("ANARI Software Development Kit (SDK)")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/KhronosGroup/ANARI-SDK/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/KhronosGroup/ANARI-SDK.git")
  7. add_versions("v0.14.1", "a1df9e917bdb0b6edb0ad4b8e59e1171468a446f850559c74ad5731317201e16")
  8. add_versions("v0.13.1", "b8979ab0dea22cf71c2eacf9421b0cf3fe5807224147c63686d6ed07e65873f4")
  9. add_versions("v0.12.1", "1fc5cf360b260cc2e652bff4a41dcf3507c84d25701dc6c6630f6f6f83656b6c")
  10. add_deps("cmake", "python 3.x", {kind = "binary"})
  11. on_install(function (package)
  12. if not package:config("shared") and package:is_plat("windows") then
  13. package:add("defines", "ANARI_STATIC_DEFINE")
  14. end
  15. local configs = {
  16. "-DBUILD_TESTING=OFF",
  17. "-DBUILD_EXAMPLES=OFF",
  18. "-DBUILD_VIEWER=OFF",
  19. "-DCTS_ENABLE_GLTF=OFF",
  20. "-DBUILD_HELIDE_DEVICE=OFF",
  21. }
  22. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  23. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (not package:config("shared") and "ON" or "OFF"))
  24. import("package.tools.cmake").install(package, configs)
  25. end)
  26. on_test(function (package)
  27. assert(package:has_cfuncs("anariLoadLibrary", {includes = "anari/anari.h"}))
  28. end)