Skip to content

Commit

Permalink
gpu-dawn: use source scanning for dawn_common target
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Gutekanst <[email protected]>
  • Loading branch information
emidoots committed Feb 13, 2022
1 parent bc7884f commit 1d1dc49
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1d1dc49

Please sign in to comment.