authorgravatar for carl@astholm.seCarl Åstholm <carl@astholm.se> 2023-10-01 20:16:00+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-10-02 16:22:07-07:00
log412d863ba5801c1376af7ab8f04a71b839a820a6
treea88330201f93ec4c24a60ed31ef4dc73839473d3
parent53775b0999527ced0550f3abb32c4a4a715af74e

std.Build: expose `-idirafter` to the build system


1 files changed, 11 insertions(+), 0 deletions(-)

lib/std/Build/Step/Compile.zig+11
......@@ -289,6 +289,7 @@ const FrameworkLinkInfo = struct {
289289pub 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
1066pub 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
10651072pub 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));