Skip to content

Commit

Permalink
Update gen_dawn.nim
Browse files Browse the repository at this point in the history
  • Loading branch information
ASVIEST authored Jul 19, 2023
1 parent 1fe6974 commit ae88889
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions generator/gen_dawn.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,8 @@ class pub DawnGenerator:

webgpuHeader: string

const headerPrelude = dedent """
const includePaths =
"-I '$1/out/gen/include' " &
"-I '$1/include' "
{.compile(
"$1/out/gen/src/dawn/dawn_proc.c",
includePaths
).}
const headerPrelude = dedent"""
{.compile("dawn/dawn_proc.c", "-I 'headers'").}
"""

func preproc* =
Expand All @@ -36,15 +29,12 @@ class pub DawnGenerator:
gclient sync
one:
cd ($self.dawnDir)
gn gen -C "out"
#one:
# cd ($self.dawnDir)
# ninja -C "out"
# cd "out"
# tree


echo "[INFO] out folder generated"
gn gen "out"
one:
cd ($self.dawnDir)
ninja -C "out"
cd "out"
tree

self.webgpuHeader = readFile(
self.dawnDir/"out/gen/include/dawn/webgpu.h"
Expand All @@ -58,7 +48,7 @@ class pub DawnGenerator:
iterator virtualFS*(): GeneratedFile=
yield self.generate()

walkDir(self.dawnDir/"out/obj/include/dawn").each i:
walkDir(self.dawnDir/"out/gen/include/dawn").each i:
yield ("headers/dawn"/i.path.extractFilename, i.path.readFile)

walkDirRec(self.dawnDir/"include/dawn").each i:
Expand Down

0 comments on commit ae88889

Please sign in to comment.