Skip to content

Commit 412d863

Browse files
castholmandrewrk
authored andcommitted
std.Build: expose -idirafter to the build system
1 parent 53775b0 commit 412d863

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/std/Build/Step/Compile.zig

+11
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ const FrameworkLinkInfo = struct {
289289
pub const IncludeDir = union(enum) {
290290
path: LazyPath,
291291
path_system: LazyPath,
292+
path_after: LazyPath,
292293
framework_path: LazyPath,
293294
framework_path_system: LazyPath,
294295
other_step: *Compile,
@@ -1062,6 +1063,12 @@ pub fn addObject(self: *Compile, obj: *Compile) void {
10621063
self.linkLibraryOrObject(obj);
10631064
}
10641065

1066+
pub fn addAfterIncludePath(self: *Compile, path: LazyPath) void {
1067+
const b = self.step.owner;
1068+
self.include_dirs.append(IncludeDir{ .path_after = path.dupe(b) }) catch @panic("OOM");
1069+
path.addStepDependencies(&self.step);
1070+
}
1071+
10651072
pub fn addSystemIncludePath(self: *Compile, path: LazyPath) void {
10661073
const b = self.step.owner;
10671074
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 {
18421849
try zig_args.append("-isystem");
18431850
try zig_args.append(include_path.getPath(b));
18441851
},
1852+
.path_after => |include_path| {
1853+
try zig_args.append("-idirafter");
1854+
try zig_args.append(include_path.getPath(b));
1855+
},
18451856
.framework_path => |include_path| {
18461857
try zig_args.append("-F");
18471858
try zig_args.append(include_path.getPath2(b, step));

0 commit comments

Comments
 (0)