xmake.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package("re-spirv")
  2. set_homepage("https://github.com/rt64/re-spirv")
  3. set_description("Lightweight and fast SPIR-V re-optimizer designed around spec constant usage.")
  4. set_license("MIT")
  5. add_urls("https://github.com/rt64/re-spirv.git", {submodules = false})
  6. add_versions("2024.08.07", "f0ad27a50339e72d4c86b3436b9f74de83a20544")
  7. add_deps("spirv-headers")
  8. on_install(function (package)
  9. io.writefile("xmake.lua", [[
  10. add_requires("spirv-headers")
  11. add_rules("mode.debug", "mode.release")
  12. set_languages("c++17")
  13. target("re-spirv")
  14. set_kind("$(kind)")
  15. add_files("re-spirv.cpp")
  16. add_headerfiles("re-spirv.h")
  17. add_packages("spirv-headers")
  18. if is_plat("windows") and is_kind("shared") then
  19. add_rules("utils.symbols.export_all", {export_classes = true})
  20. end
  21. target("re-spirv-cli")
  22. set_kind("binary")
  23. add_files("re-spirv-cli.cpp")
  24. add_deps("re-spirv")
  25. ]])
  26. import("package.tools.xmake").install(package)
  27. end)
  28. on_test(function (package)
  29. assert(package:check_cxxsnippets({test = [[
  30. void test() {
  31. respv::Shader shader;
  32. }
  33. ]]}, {configs = {languages = "c++17"}, includes = "re-spirv.h"}))
  34. end)