gpu-dawn: use source scanning for dawn_native target

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-02-13 01:40:48 -07:00 committed by Stephen Gutekanst
parent 2e2eb57781
commit 9dcacacca1
2 changed files with 12 additions and 78 deletions

View file

@ -518,10 +518,18 @@ fn buildLibDawnNative(b: *Builder, step: *std.build.LibExeObjStep, options: Opti
}) catch unreachable;
var sources = std.ArrayList([]const u8).init(b.allocator);
sources.appendSlice(&.{
thisDir() ++ "/src/dawn/sources/dawn_native.cpp",
thisDir() ++ "/libs/dawn/out/Debug/gen/src/dawn/dawn_proc.c",
}) catch unreachable;
inline for (&[_][]const u8{
"out/Debug/gen/src/dawn/",
"src/dawn_native/",
"src/dawn_native/utils/",
}) |dir| scanSources(
b,
&sources,
"libs/dawn/" ++ dir,
&.{ ".cpp", ".c", ".cc" },
&.{},
&.{ "test", "benchmark", "mock", "SpirvValidation.cpp", "XlibXcbFunctions.cpp" },
) catch unreachable;
// dawn_native_utils_gen
sources.append(thisDir() ++ "/src/dawn/sources/dawn_native_utils_gen.cpp") catch unreachable;
@ -763,7 +771,6 @@ fn buildLibDawnNative(b: *Builder, step: *std.build.LibExeObjStep, options: Opti
}
for ([_][]const u8{
"src/dawn_native/DawnNative.cpp",
"src/dawn_native/null/NullBackend.cpp",
}) |path| {
var abs_path = std.fs.path.join(b.allocator, &.{ thisDir(), "libs/dawn", path }) catch unreachable;