gpu-dawn: use source scanning for spirv_tools target

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-02-13 01:28:29 -07:00 committed by Stephen Gutekanst
parent a0b513f0da
commit 3368fa9da0
2 changed files with 11 additions and 29 deletions

View file

@ -984,11 +984,17 @@ fn buildLibSPIRVTools(b: *Builder, step: *std.build.LibExeObjStep, options: Opti
// spvtools
var sources = std.ArrayList([]const u8).init(b.allocator);
sources.appendSlice(&.{
thisDir() ++ "/src/dawn/sources/spirv_tools.cpp",
thisDir() ++ "/libs/dawn/third_party/vulkan-deps/spirv-tools/src/source/operand.cpp",
thisDir() ++ "/libs/dawn/third_party/vulkan-deps/spirv-tools/src/source/spirv_reducer_options.cpp",
}) catch unreachable;
inline for (&[_][]const u8{
"third_party/vulkan-deps/spirv-tools/src/source/",
"third_party/vulkan-deps/spirv-tools/src/source/util/",
}) |dir| scanSources(
b,
&sources,
"libs/dawn/" ++ dir,
&.{ ".cpp", ".c", ".cc" },
&.{},
&.{ "test", "benchmark" },
) catch unreachable;
// spvtools_val
sources.append(thisDir() ++ "/src/dawn/sources/spirv_tools_val.cpp") catch unreachable;