std.Build: expose -idirafter to the build system

This commit is contained in:
Carl Åstholm 2023-10-01 20:16:00 +02:00 committed by Andrew Kelley
parent 53775b0999
commit 412d863ba5

View File

@ -289,6 +289,7 @@ const FrameworkLinkInfo = struct {
pub const IncludeDir = union(enum) {
path: LazyPath,
path_system: LazyPath,
path_after: LazyPath,
framework_path: LazyPath,
framework_path_system: LazyPath,
other_step: *Compile,
@ -1062,6 +1063,12 @@ pub fn addObject(self: *Compile, obj: *Compile) void {
self.linkLibraryOrObject(obj);
}
pub fn addAfterIncludePath(self: *Compile, path: LazyPath) void {
const b = self.step.owner;
self.include_dirs.append(IncludeDir{ .path_after = path.dupe(b) }) catch @panic("OOM");
path.addStepDependencies(&self.step);
}
pub fn addSystemIncludePath(self: *Compile, path: LazyPath) void {
const b = self.step.owner;
self.include_dirs.append(IncludeDir{ .path_system = path.dupe(b) }) catch @panic("OOM");
@ -1842,6 +1849,10 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
try zig_args.append("-isystem");
try zig_args.append(include_path.getPath(b));
},
.path_after => |include_path| {
try zig_args.append("-idirafter");
try zig_args.append(include_path.getPath(b));
},
.framework_path => |include_path| {
try zig_args.append("-F");
try zig_args.append(include_path.getPath2(b, step));