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 {...@@ -289,6 +289,7 @@ const FrameworkLinkInfo = struct {
289pub const IncludeDir = union(enum) {289pub const IncludeDir = union(enum) {
290 path: LazyPath,290 path: LazyPath,
291 path_system: LazyPath,291 path_system: LazyPath,
292 path_after: LazyPath,
292 framework_path: LazyPath,293 framework_path: LazyPath,
293 framework_path_system: LazyPath,294 framework_path_system: LazyPath,
294 other_step: *Compile,295 other_step: *Compile,
...@@ -1062,6 +1063,12 @@ pub fn addObject(self: *Compile, obj: *Compile) void {...@@ -1062,6 +1063,12 @@ pub fn addObject(self: *Compile, obj: *Compile) void {
1062 self.linkLibraryOrObject(obj);1063 self.linkLibraryOrObject(obj);
1063}1064}
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
1065pub fn addSystemIncludePath(self: *Compile, path: LazyPath) void {1072pub fn addSystemIncludePath(self: *Compile, path: LazyPath) void {
1066 const b = self.step.owner;1073 const b = self.step.owner;
1067 self.include_dirs.append(IncludeDir{ .path_system = path.dupe(b) }) catch @panic("OOM");1074 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 {...@@ -1842,6 +1849,10 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void {
1842 try zig_args.append("-isystem");1849 try zig_args.append("-isystem");
1843 try zig_args.append(include_path.getPath(b));1850 try zig_args.append(include_path.getPath(b));
1844 },1851 },
1852 .path_after => |include_path| {
1853 try zig_args.append("-idirafter");
1854 try zig_args.append(include_path.getPath(b));
1855 },
1845 .framework_path => |include_path| {1856 .framework_path => |include_path| {
1846 try zig_args.append("-F");1857 try zig_args.append("-F");
1847 try zig_args.append(include_path.getPath2(b, step));1858 try zig_args.append(include_path.getPath2(b, step));