update zig build api and family enum
This commit is contained in:
parent
adfeed86b1
commit
385e544613
28
build.zig
28
build.zig
|
@ -1,25 +1,35 @@
|
|||
const std = @import("std");
|
||||
|
||||
pub fn build(b: *std.build.Builder) void {
|
||||
// Standard release options allow the person running `zig build` to select
|
||||
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
|
||||
const mode = b.standardReleaseOptions();
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
const target = b.standardTargetOptions(.{});
|
||||
|
||||
const lib = b.addStaticLibrary("uf2", "src/main.zig");
|
||||
lib.setBuildMode(mode);
|
||||
const lib = b.addStaticLibrary(.{
|
||||
.name = "uf2",
|
||||
.root_source_file = .{ .path = "src/main.zig" },
|
||||
.target = target,
|
||||
.optimize = optimize,
|
||||
});
|
||||
lib.install();
|
||||
|
||||
const main_tests = b.addTest("src/main.zig");
|
||||
main_tests.setBuildMode(mode);
|
||||
const main_tests = b.addTest(.{
|
||||
.root_source_file = .{ .path = "src/main.zig" },
|
||||
});
|
||||
|
||||
const test_step = b.step("test", "Run library tests");
|
||||
test_step.dependOn(&main_tests.step);
|
||||
|
||||
const gen = b.addExecutable("gen", "src/gen.zig");
|
||||
const gen = b.addExecutable(.{
|
||||
.name = "gen",
|
||||
.root_source_file = .{ .path = "src/gen.zig" },
|
||||
});
|
||||
const gen_run_step = gen.run();
|
||||
const gen_step = b.step("gen", "Generate family id enum");
|
||||
gen_step.dependOn(&gen_run_step.step);
|
||||
|
||||
const exe = b.addExecutable("example", "src/example.zig");
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "example",
|
||||
.root_source_file = .{ .path = "src/example.zig" },
|
||||
});
|
||||
exe.install();
|
||||
}
|
||||
|
|
2
deps/uf2
vendored
2
deps/uf2
vendored
|
@ -1 +1 @@
|
|||
Subproject commit ffe793f973ff8fc288365a2183c9727aa40aed07
|
||||
Subproject commit 35842c770bf553ce01a48ded68f3763e5e140a1e
|
|
@ -30,5 +30,5 @@ pub fn main() !void {
|
|||
\\
|
||||
, .{ entry.short_name, entry.id });
|
||||
|
||||
try writer.writeAll("};\n");
|
||||
try writer.writeAll(" _,\n};\n");
|
||||
}
|
||||
|
|
|
@ -551,5 +551,8 @@ pub const FamilyId = enum(u32) {
|
|||
RP2040 = 0xe48bff56,
|
||||
STM32L4 = 0x00ff6919,
|
||||
GD32VF103 = 0x9af03e33,
|
||||
CSK4 = 0x4f6ace52,
|
||||
CSK6 = 0x6e7348a8,
|
||||
M0SENSE = 0x11de784a,
|
||||
_,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user