xmake.lua 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package("vulkanscenegraph")
  2. set_homepage("https://vsg-dev.github.io/VulkanSceneGraph/")
  3. set_description("VulkanSceneGraph (VSG), is a modern, cross platform, high performance scene graph library built upon Vulkan graphics/compute API.")
  4. set_license("MIT")
  5. add_urls("https://github.com/vsg-dev/VulkanSceneGraph/archive/refs/tags/VulkanSceneGraph-$(version).tar.gz",
  6. "https://github.com/vsg-dev/VulkanSceneGraph.git")
  7. add_versions("1.0.2", "526acd58d6e3a3bd3c3169996e0616d5c4a01e793dc064e8d20217791743bab5")
  8. add_deps("cmake", "vulkansdk")
  9. on_load("windows", function (package)
  10. package:add("defines", "WIN32")
  11. if package:config("shared") then
  12. package:add("defines", "VSG_SHARED_LIBRARY")
  13. end
  14. end)
  15. on_install("windows", "macosx", "linux", function (package)
  16. io.replace("CMakeLists.txt", "vsg_add_target_clobber()", "", {plain = true})
  17. io.replace("CMakeLists.txt", "vsg_add_target_uninstall()", "", {plain = true})
  18. local configs = {}
  19. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  20. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  21. import("package.tools.cmake").install(package, configs)
  22. end)
  23. on_test(function (package)
  24. assert(package:check_cxxsnippets({test = [[
  25. void test(int argc, char* argv[]) {
  26. bool help = false;
  27. vsg::CommandLine arguments(&argc, argv);
  28. if (arguments.read("--help")) help = true;
  29. }
  30. ]]}, {configs = {languages = "c++17"}, includes = "vsg/utils/CommandLine.h"}))
  31. end)