xmake.lua 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package("spirv-reflect")
  2. set_homepage("https://github.com/KhronosGroup/SPIRV-Reflect")
  3. set_description("SPIRV-Reflect is a lightweight library that provides a C/C++ reflection API for SPIR-V shader bytecode in Vulkan applications.")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/KhronosGroup/SPIRV-Reflect.git")
  6. -- when adding a new sdk version, please ensure vulkan-headers, vulkan-hpp, vulkan-loader, vulkan-tools, vulkan-validationlayers, vulkan-utility-libraries, spirv-headers, spirv-reflect, spirv-tools, glslang and volk packages are updated simultaneously
  7. add_versions("1.2.154+1", "5de48fe8d3ef434e846d64ed758adc5d26335ae5")
  8. add_versions("1.2.162+0", "481e34d666031eae28423f3b723a1a8c717d7636")
  9. add_versions("1.2.189+1", "272e050728de8d4a4ce9e7101c1244e6ff56e5b0")
  10. add_versions("1.3.231+1", "b68b5a8a5d8ab5fce79e6596f3a731291046393a")
  11. add_versions("1.3.250+1", "1fd43331f0bd77cc0f421745781f79a14d8f2bb1")
  12. add_versions("1.3.261+1", "d7e316e7d592d16ac58f1fe39b1df7babfe65c0d")
  13. add_versions("1.3.268+0", "3f468129720eded0cef4077302e491036d099856")
  14. add_versions("1.3.275+0", "2f7460f0be0f73c9ffde719bc3e924b4250f4d98")
  15. add_versions("1.3.280+0", "8406f76dcf6cca11fe430058c4f0ed4b846f3be4")
  16. add_versions("1.3.283+0", "ee5b57fba6a986381f998567761bbc064428e645")
  17. add_versions("1.3.290+0", "b4dc70d8e6ac30c719a2d05b8ad05e1d277c92b4")
  18. add_versions("1.4.309+0", "c637858562fbce1b6f5dc7ca48d4e8a5bd117b70")
  19. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  20. add_deps("spirv-headers")
  21. on_install("windows", "linux", "macosx", "mingw", "android", function (package)
  22. io.gsub("spirv_reflect.h", "#include \"%.%/include%/spirv%/unified1%/spirv.h\"", "#include \"spirv/unified1/spirv.h\"")
  23. io.writefile("xmake.lua", [[
  24. add_rules("mode.debug", "mode.release")
  25. add_requires("spirv-headers")
  26. target("spirv-reflect-static")
  27. set_kind("static")
  28. add_packages("spirv-headers", {public = true})
  29. add_files("spirv_reflect.c")
  30. add_headerfiles("spirv_reflect.h")
  31. target("spirv-reflect")
  32. set_kind("binary")
  33. set_languages("c++11")
  34. add_deps("spirv-reflect-static")
  35. add_includedirs(".")
  36. add_files("main.cpp", "examples/arg_parser.cpp", "examples/common.cpp", "common/output_stream.cpp")
  37. ]])
  38. import("package.tools.xmake").install(package)
  39. end)
  40. on_test(function (package)
  41. assert(package:has_cfuncs("spvReflectGetCodeSize", {includes = "spirv_reflect.h"}))
  42. end)