union IncludeDir [src]
Fields
path: LazyPath
path_system: LazyPath
path_after: LazyPath
framework_path: LazyPath
framework_path_system: LazyPath
other_step: *Step.Compile
config_header_step: *Step.ConfigHeader
embed_path: LazyPath
Members
- appendZigProcessFlags (Function)
Source
pub const IncludeDir = union(enum) {
path: LazyPath,
path_system: LazyPath,
path_after: LazyPath,
framework_path: LazyPath,
framework_path_system: LazyPath,
other_step: *Step.Compile,
config_header_step: *Step.ConfigHeader,
embed_path: LazyPath,
pub fn appendZigProcessFlags(
include_dir: IncludeDir,
b: *std.Build,
zig_args: *std.array_list.Managed([]const u8),
asking_step: ?*Step,
) !void {
const flag: []const u8, const lazy_path: LazyPath = switch (include_dir) {
// zig fmt: off
.path => |lp| .{ "-I", lp },
.path_system => |lp| .{ "-isystem", lp },
.path_after => |lp| .{ "-idirafter", lp },
.framework_path => |lp| .{ "-F", lp },
.framework_path_system => |lp| .{ "-iframework", lp },
.config_header_step => |ch| .{ "-I", ch.getOutputDir() },
.other_step => |comp| .{ "-I", comp.installed_headers_include_tree.?.getDirectory() },
// zig fmt: on
.embed_path => |lazy_path| {
// Special case: this is a single arg.
const resolved = lazy_path.getPath3(b, asking_step);
const arg = b.fmt("--embed-dir={f}", .{resolved});
return zig_args.append(arg);
},
};
const resolved_str = try lazy_path.getPath3(b, asking_step).toString(b.graph.arena);
return zig_args.appendSlice(&.{ flag, resolved_str });
}
}