Skip to content

Commit

Permalink
nzsl: Fix compile.shaders rule
Browse files Browse the repository at this point in the history
  • Loading branch information
SirLynix committed Oct 17, 2024
1 parent 0809088 commit 4cbdb18
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/n/nzsl/rules/compile_shaders.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ rule("compile.shaders")
end
end

target:rule_add(target:rule("@nzsl/archive.shaders"))
for archive, archivefiles in table.orderpairs(archives) do
local args = { rule = "@nzsl/archive.shaders", always_added = true, compress = true, files = archivefiles }
if archive:endswith(".nzsla.h") or archive:endswith(".nzsla.hpp") then
args.header = true
end
if not table.empty(archives) then
assert(target:rule("@nzsl/archive.shaders"), "you must add the @nzsl/archive.shaders rule to the target")
for archive, archivefiles in table.orderpairs(archives) do
local args = { rule = "@nzsl/archive.shaders", always_added = true, compress = true, files = archivefiles }
if archive:endswith(".nzsla.h") or archive:endswith(".nzsla.hpp") then
args.header = true
end

target:add("files", archive, args)
target:add("files", archive, args)
end
end
end)

Expand Down

0 comments on commit 4cbdb18

Please sign in to comment.