forked from ZigEmbeddedGroup/microchip-atmega
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
45 lines (40 loc) · 1.49 KB
/
build.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const std = @import("std");
const microzig = @import("microzig");
pub const boards = @import("src/boards.zig");
pub const chips = @import("src/chips.zig");
pub fn build(b: *std.build.Builder) void {
const optimize = b.standardOptimizeOption(.{});
inline for (@typeInfo(boards).Struct.decls) |decl| {
const exe = microzig.addEmbeddedExecutable(b, .{
.name = @field(boards, decl.name).name ++ ".minimal",
.source_file = .{
.path = "test/programs/minimal.zig",
},
.backing = .{ .board = @field(boards, decl.name) },
.optimize = optimize,
});
exe.installArtifact(b);
}
inline for (@typeInfo(boards).Struct.decls) |decl| {
const exe = microzig.addEmbeddedExecutable(b, .{
.name = @field(boards, decl.name).name ++ ".uart",
.source_file = .{
.path = "test/programs/uart.zig",
},
.backing = .{ .board = @field(boards, decl.name) },
.optimize = optimize,
});
exe.installArtifact(b);
}
inline for (@typeInfo(chips).Struct.decls) |decl| {
const exe = microzig.addEmbeddedExecutable(b, .{
.name = @field(chips, decl.name).name ++ ".minimal",
.source_file = .{
.path = "test/programs/minimal.zig",
},
.backing = .{ .chip = @field(chips, decl.name) },
.optimize = optimize,
});
exe.installArtifact(b);
}
}