| ... | @@ -1084,6 +1084,7 @@ pub const LibExeObjStep = struct { | ... | @@ -1084,6 +1084,7 @@ pub const LibExeObjStep = struct { |
| 1084 | | 1084 | |
| 1085 | const IncludeDir = union(enum) { | 1085 | const IncludeDir = union(enum) { |
| 1086 | RawPath: []const u8, | 1086 | RawPath: []const u8, |
| | 1087 | RawPathSystem: []const u8, |
| 1087 | OtherStep: *LibExeObjStep, | 1088 | OtherStep: *LibExeObjStep, |
| 1088 | }; | 1089 | }; |
| 1089 | | 1090 | |
| ... | @@ -1545,6 +1546,10 @@ pub const LibExeObjStep = struct { | ... | @@ -1545,6 +1546,10 @@ pub const LibExeObjStep = struct { |
| 1545 | out.print("pub const {} = {};\n", name, value) catch unreachable; | 1546 | out.print("pub const {} = {};\n", name, value) catch unreachable; |
| 1546 | } | 1547 | } |
| 1547 | | 1548 | |
| | 1549 | pub fn addSystemIncludeDir(self: *LibExeObjStep, path: []const u8) void { |
| | 1550 | self.include_dirs.append(IncludeDir{ .RawPathSystem = self.builder.dupe(path) }) catch unreachable; |
| | 1551 | } |
| | 1552 | |
| 1548 | pub fn addIncludeDir(self: *LibExeObjStep, path: []const u8) void { | 1553 | pub fn addIncludeDir(self: *LibExeObjStep, path: []const u8) void { |
| 1549 | self.include_dirs.append(IncludeDir{ .RawPath = self.builder.dupe(path) }) catch unreachable; | 1554 | self.include_dirs.append(IncludeDir{ .RawPath = self.builder.dupe(path) }) catch unreachable; |
| 1550 | } | 1555 | } |
| ... | @@ -1823,11 +1828,15 @@ pub const LibExeObjStep = struct { | ... | @@ -1823,11 +1828,15 @@ pub const LibExeObjStep = struct { |
| 1823 | | 1828 | |
| 1824 | for (self.include_dirs.toSliceConst()) |include_dir| { | 1829 | for (self.include_dirs.toSliceConst()) |include_dir| { |
| 1825 | switch (include_dir) { | 1830 | switch (include_dir) { |
| 1826 | IncludeDir.RawPath => |include_path| { | 1831 | .RawPath => |include_path| { |
| | 1832 | try zig_args.append("-I"); |
| | 1833 | try zig_args.append(self.builder.pathFromRoot(include_path)); |
| | 1834 | }, |
| | 1835 | .RawPathSystem => |include_path| { |
| 1827 | try zig_args.append("-isystem"); | 1836 | try zig_args.append("-isystem"); |
| 1828 | try zig_args.append(self.builder.pathFromRoot(include_path)); | 1837 | try zig_args.append(self.builder.pathFromRoot(include_path)); |
| 1829 | }, | 1838 | }, |
| 1830 | IncludeDir.OtherStep => |other| { | 1839 | .OtherStep => |other| { |
| 1831 | const h_path = other.getOutputHPath(); | 1840 | const h_path = other.getOutputHPath(); |
| 1832 | try zig_args.append("-isystem"); | 1841 | try zig_args.append("-isystem"); |
| 1833 | try zig_args.append(fs.path.dirname(h_path).?); | 1842 | try zig_args.append(fs.path.dirname(h_path).?); |