forked from ZigEmbeddedGroup/microzig
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
28 lines (24 loc) · 833 Bytes
/
build.zig
File metadata and controls
28 lines (24 loc) · 833 Bytes
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
const std = @import("std");
const example_dep_names: []const []const u8 = &.{
"espressif/esp",
"gigadevice/gd32",
"microchip/samd51",
"microchip/atmega",
"nordic/nrf5x",
"nxp/lpc",
"raspberrypi/rp2xxx",
"stmicro/stm32",
"wch/ch32v",
};
pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{});
// Build all examples
for (example_dep_names) |example_dep_name| {
const example_dep = b.dependency(example_dep_name, .{
.optimize = optimize,
});
const example_dep_install_step = example_dep.builder.getInstallStep();
example_dep.builder.install_path = b.pathJoin(&.{ b.install_path, example_dep_name }); // HACK: install in the current directory
b.getInstallStep().dependOn(example_dep_install_step);
}
}