xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132
  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.12.1", "1fc5cf360b260cc2e652bff4a41dcf3507c84d25701dc6c6630f6f6f83656b6c")
  8. add_deps("cmake", "python 3.x", {kind = "binary"})
  9. on_install(function (package)
  10. if not package:config("shared") and package:is_plat("windows") then
  11. package:add("defines", "ANARI_STATIC_DEFINE")
  12. end
  13. local configs = {
  14. "-DBUILD_TESTING=OFF",
  15. "-DBUILD_EXAMPLES=OFF",
  16. "-DBUILD_VIEWER=OFF",
  17. "-DCTS_ENABLE_GLTF=OFF",
  18. "-DBUILD_HELIDE_DEVICE=OFF",
  19. }
  20. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  21. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (not package:config("shared") and "ON" or "OFF"))
  22. import("package.tools.cmake").install(package, configs)
  23. end)
  24. on_test(function (package)
  25. assert(package:has_cfuncs("anariLoadLibrary", {includes = "anari/anari.h"}))
  26. end)