diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-05-16 20:00:47 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-05-16 20:39:01 -0700 |
| commit | 728ce2d7c18e23ca6c36d86f4ee1ea4ce3ac81e2 (patch) | |
| tree | b84ffae450a01a7fa2cf22d87176fb633125b359 /build.zig | |
| parent | df5085bde012773b974f58e8ee28ed90ff686468 (diff) | |
| download | zig-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.zig | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); |
