aboutsummaryrefslogtreecommitdiffstats
path: root/build.zig
blob: 8493bbb893f4890ec1d1b9169dbb1431d3094595 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const std = @import("std");

pub fn build(b: *std.Build) void {
    const target = b.resolveTargetQuery(.{
        .cpu_arch = .thumb,
        .cpu_model = .{ .explicit = &std.Target.arm.cpu.cortex_m4 },
        .os_tag = .freestanding,
        .abi = .none
    });

    const exe = b.addExecutable(.{
        .name = "stm32",
        .root_source_file = b.path("src/startup.zig"),
        .target = target,
        //.optimize = .Debug,
        .optimize = .ReleaseSafe,
        .linkage = .static,
    });

    exe.setLinkerScriptPath(b.path("link.ld"));

    b.installArtifact(exe);
}