From 39109c93899fb0458a47d18f95faa4916b089c05 Mon Sep 17 00:00:00 2001 From: Stephen Gutekanst Date: Sun, 13 Feb 2022 01:57:20 -0700 Subject: [PATCH] gpu-dawn: use source scanning for dawn_common target Signed-off-by: Stephen Gutekanst --- gpu-dawn/build.zig | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/gpu-dawn/build.zig b/gpu-dawn/build.zig index 40c929ae..be87777b 100644 --- a/gpu-dawn/build.zig +++ b/gpu-dawn/build.zig @@ -397,20 +397,14 @@ fn buildLibDawnCommon(b: *Builder, step: *std.build.LibExeObjStep, options: Opti flags.append(include("libs/dawn/src")) catch unreachable; var sources = std.ArrayList([]const u8).init(b.allocator); - for ([_][]const u8{ - "src/common/Assert.cpp", - "src/common/DynamicLib.cpp", - "src/common/GPUInfo.cpp", - "src/common/Log.cpp", - "src/common/Math.cpp", - "src/common/RefCounted.cpp", - "src/common/Result.cpp", - "src/common/SlabAllocator.cpp", - "src/common/SystemUtils.cpp", - }) |path| { - var abs_path = std.fs.path.join(b.allocator, &.{ thisDir(), "libs/dawn", path }) catch unreachable; - sources.append(abs_path) catch unreachable; - } + scanSources( + b, + &sources, + "libs/dawn/src/common/", + &.{ ".cpp", ".c", ".cc" }, + &.{}, + &.{ "test", "benchmark", "mock", "WindowsUtils.cpp", }, + ) catch unreachable; const target = (std.zig.system.NativeTargetInfo.detect(b.allocator, step.target) catch unreachable).target; if (target.os.tag == .macos) {