Build: Add deferred compilation shader option

This commit is contained in:
SirLynix
2022-05-05 20:17:16 +02:00
parent 2a3646135a
commit 23e869d4d6
2 changed files with 51 additions and 14 deletions

View File

@@ -0,0 +1,21 @@
task("compile-shaders")
set_menu({
-- Settings menu usage
usage = "xmake compile-shaders [options]",
description = "Compile engine shaders"
})
on_run(function ()
import("core.project.task")
print("Compiling NZSLC...")
task.run("build", {target = "NazaraShaderCompiler"})
print("Compiling shaders...")
for _, filepath in pairs(os.files("src/Nazara/*/Resources/**.nzsl")) do
print(" - Compiling " .. filepath)
local argv = {"--compile", "--partial", "--header-file", path.join("..", "..", filepath) }
task.run("run", {target = "NazaraShaderCompiler", arguments = argv})
end
end)