Skip to content

Instantly share code, notes, and snippets.

@DutchGhost
Created September 23, 2020 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DutchGhost/386c113d18f5b67b7ea86d1441425f8b to your computer and use it in GitHub Desktop.
Save DutchGhost/386c113d18f5b67b7ea86d1441425f8b to your computer and use it in GitHub Desktop.
const Builder = @import("std").build.Builder;
const std = @import("std");
const cpu = @import("std").Target.arm;
pub fn build(b: *Builder) void {
const mode = b.standardReleaseOptions();
const lib = b.addStaticLibrary("krate", "src/main.zig");
lib.setBuildMode(mode);
lib.target = std.zig.CrossTarget{
.cpu_arch = .thumb,
.os_tag = .freestanding,
.abi = .gnu,
.cpu_model = .{ .explicit = &cpu.cpu.cortex_m4 },
};
lib.install();
var main_tests = b.addTest("src/main.zig");
main_tests.setBuildMode(mode);
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&main_tests.step);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment