aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-05-16 20:00:47 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-05-16 20:39:01 -0700
commit728ce2d7c18e23ca6c36d86f4ee1ea4ce3ac81e2 (patch)
treeb84ffae450a01a7fa2cf22d87176fb633125b359 /build.zig
parentdf5085bde012773b974f58e8ee28ed90ff686468 (diff)
downloadzig-728ce2d7c18e23ca6c36d86f4ee1ea4ce3ac81e2.tar.gz
zig-728ce2d7c18e23ca6c36d86f4ee1ea4ce3ac81e2.zip
tweaks to --build-id
* build.zig: the result of b.option() can be assigned directly in many cases thanks to the return type being an optional * std.Build: make the build system aware of the std.Build.Step.Compile.BuildId type when used as an option. - remove extraneous newlines in error logs * simplify caching logic * simplify hexstring parsing tests and use a doc test * simplify hashing logic. don't use an optional when the `none` tag already provides this meaning. * CLI: fix incorrect linker arg parsing
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/build.zig b/build.zig
index 62f1d86441..a75269083f 100644
--- a/build.zig
+++ b/build.zig
@@ -167,8 +167,11 @@ pub fn build(b: *std.Build) !void {
exe.sanitize_thread = sanitize_thread;
exe.entitlements = entitlements;
- if (b.option([]const u8, "build-id", "Include a build id note")) |build_id|
- exe.build_id = try std.Build.CompileStep.BuildId.parse(b.allocator, build_id);
+ exe.build_id = b.option(
+ std.Build.Step.Compile.BuildId,
+ "build-id",
+ "Request creation of '.note.gnu.build-id' section",
+ );
b.installArtifact(exe);