fix build pkg (#14)

This commit is contained in:
Matt Knight 2023-06-25 12:05:34 -07:00 committed by GitHub
parent ae3e3e39d1
commit c2edba7349
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -8,6 +8,21 @@ See https://github.com/microsoft/uf2#file-containers for how we're going to embe
For use in a build.zig:
```zig
const uf2 = @import("uf2");
pub fn build(b: *Build) void {
// ...
const uf2_dep = b.dependency("uf2", .{});
const uf2_file = uf2.from_elf(uf2_dep, exe, .{ .family_id = .RP2040 });
_ = b.addInstallFile(uf2_file, "bin/test.uf2");
}
```
# Manually Executing elf2uf2
```zig
pub fn build(b: *Build) void {
// ...

View File

@ -5,7 +5,7 @@ const FileSource = std.Build.FileSource;
const uf2 = @import("src/uf2.zig");
pub fn from_elf(dep: Dependency, exe: CompileStep, opts: uf2.Options) FileSource {
pub fn from_elf(dep: *Dependency, exe: *CompileStep, opts: uf2.Options) FileSource {
std.debug.assert(!opts.bundle_source); // TODO: bundle source in UF2 File
const b = dep.builder;
const elf2uf2 = dep.artifact("elf2uf2");