Created
September 23, 2020 15:32
-
-
Save DutchGhost/386c113d18f5b67b7ea86d1441425f8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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