Extracted from #14647.
|
emit_analysis: EmitOption = .default, |
|
emit_asm: EmitOption = .default, |
|
emit_bin: EmitOption = .default, |
|
emit_docs: EmitOption = .default, |
|
emit_implib: EmitOption = .default, |
|
emit_llvm_bc: EmitOption = .default, |
|
emit_llvm_ir: EmitOption = .default, |
|
// Lots of things depend on emit_h having a consistent path, |
|
// so it is not an EmitOption for now. |
|
emit_h: bool = false, |
|
pub const EmitOption = union(enum) { |
|
default: void, |
|
no_emit: void, |
|
emit: void, |
|
emit_to: []const u8, |
|
|
|
fn getArg(self: @This(), b: *std.Build, arg_name: []const u8) ?[]const u8 { |
|
return switch (self) { |
|
.no_emit => b.fmt("-fno-{s}", .{arg_name}), |
|
.default => null, |
|
.emit => b.fmt("-f{s}", .{arg_name}), |
|
.emit_to => |path| b.fmt("-f{s}={s}", .{ arg_name, path }), |
|
}; |
|
} |
|
}; |
All of these, including emit_h, will no longer have the option to specify an output path, same as #14951. Instead, the two choices will be null, or providing a FileSource to interact with the rest of the build system. The zig compiler itself will only ever see -femit-foo or -fno-emit-foo. It will always put the artifact in the cache directory, and the build script must rely on other steps that interact with FileSource to do anything with the artifacts.
Extracted from #14647.
zig/lib/std/Build/CompileStep.zig
Lines 55 to 64 in 68c7261
zig/lib/std/Build/CompileStep.zig
Lines 295 to 309 in 68c7261
All of these, including
emit_h, will no longer have the option to specify an output path, same as #14951. Instead, the two choices will be null, or providing a FileSource to interact with the rest of the build system. The zig compiler itself will only ever see -femit-foo or -fno-emit-foo. It will always put the artifact in the cache directory, and the build script must rely on other steps that interact with FileSource to do anything with the artifacts.