From 2e5c57f48fbdcd44012f3ab1887caf8fd58ae28c Mon Sep 17 00:00:00 2001 From: Ivan Velickovic Date: Tue, 29 Oct 2024 13:55:41 +1100 Subject: [PATCH] build.zig: override MICROKIT_SDK environment varaible We always have to provide -Dsdk= when using build.zig and we don't want the Microkit tool to be using incorrect artifacts if the MICROKIT_SDK environment variable is set. Signed-off-by: Ivan Velickovic --- examples/simple/build.zig | 1 + examples/zig/build.zig | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/simple/build.zig b/examples/simple/build.zig index c723c49f..c97aea89 100644 --- a/examples/simple/build.zig +++ b/examples/simple/build.zig @@ -200,6 +200,7 @@ pub fn build(b: *std.Build) void { b.getInstallPath(.prefix, "./report.txt") }); microkit_tool_cmd.step.dependOn(b.getInstallStep()); + microkit_tool_cmd.setEnvironmentVariable("MICROKIT_SDK", microkit_sdk); // Add the "microkit" step, and make it the default step when we execute `zig build` const microkit_step = b.step("microkit", "Compile and build the final bootable image"); microkit_step.dependOn(µkit_tool_cmd.step); diff --git a/examples/zig/build.zig b/examples/zig/build.zig index a6e64cd5..077f065f 100644 --- a/examples/zig/build.zig +++ b/examples/zig/build.zig @@ -115,6 +115,7 @@ pub fn build(b: *std.Build) void { b.getInstallPath(.prefix, "./report.txt") }); microkit_tool_cmd.step.dependOn(b.getInstallStep()); + microkit_tool_cmd.setEnvironmentVariable("MICROKIT_SDK", microkit_sdk); // Add the "microkit" step, and make it the default step when we execute `zig build` const microkit_step = b.step("microkit", "Compile and build the final bootable image"); microkit_step.dependOn(µkit_tool_cmd.step);