xmake.lua 1.2 KB

12345678910111213141516171819202122232425
  1. package("directxshadercompiler")
  2. set_homepage("https://github.com/microsoft/DirectXShaderCompiler/")
  3. set_description("DirectX Shader Compiler")
  4. set_license("LLVM")
  5. local date = {["1.5.2010"] = "2020_10-22",
  6. ["1.6.2104"] = "2021_04-20",
  7. ["1.6.2106"] = "2021_07_01"}
  8. add_urls("https://github.com/microsoft/DirectXShaderCompiler/releases/download/v$(version).zip", {version = function (version) return version .. "/dxc_" .. date[tostring(version)] end})
  9. add_versions("1.5.2010", "b691f63778f470ebeb94874426779b2f60685fc8711adf1b1f9f01535d9b67f8")
  10. add_versions("1.6.2104", "ee5e96d58134957443ded04be132e2e19240c534d7602e3ab8fd5adc5156014a")
  11. add_versions("1.6.2106", "053b2d90c227cae84e7ce636bc4f7c25acd224c31c11a324885acbf5dd8b7aac")
  12. on_install("windows|x64", function (package)
  13. os.cp("bin/x64/*", package:installdir("bin"))
  14. os.cp("inc/*", package:installdir("include"))
  15. os.cp("lib/x64/*", package:installdir("lib"))
  16. package:addenv("PATH", "bin")
  17. end)
  18. on_test(function (package)
  19. os.vrun("dxc -help")
  20. assert(package:has_cxxfuncs("DxcCreateInstance", {includes = {"windows.h", "dxcapi.h"}}))
  21. end)