authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-11-05 14:32:17-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-11-05 14:32:17-05:00
log9bc4f8ea77df395b9f2407ddfa4734bb4a1c4139
tree044ddd23f3c3babd92460ae0642b25e618b55dcc
parentcb8af1c6d48d5fdb26484a070b8af069c4152049
signaturelock-open Commit is signed but in an unrecognized format.

zig build: addIncludeDir does -I instead of -isystem


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

lib/std/build.zig+11-2
......@@ -1084,6 +1084,7 @@ pub const LibExeObjStep = struct {
10841084
10851085 const IncludeDir = union(enum) {
10861086 RawPath: []const u8,
1087 RawPathSystem: []const u8,
10871088 OtherStep: *LibExeObjStep,
10881089 };
10891090
......@@ -1545,6 +1546,10 @@ pub const LibExeObjStep = struct {
15451546 out.print("pub const {} = {};\n", name, value) catch unreachable;
15461547 }
15471548
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
15481553 pub fn addIncludeDir(self: *LibExeObjStep, path: []const u8) void {
15491554 self.include_dirs.append(IncludeDir{ .RawPath = self.builder.dupe(path) }) catch unreachable;
15501555 }
......@@ -1823,11 +1828,15 @@ pub const LibExeObjStep = struct {
18231828
18241829 for (self.include_dirs.toSliceConst()) |include_dir| {
18251830 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| {
18271836 try zig_args.append("-isystem");
18281837 try zig_args.append(self.builder.pathFromRoot(include_path));
18291838 },
1830 IncludeDir.OtherStep => |other| {
1839 .OtherStep => |other| {
18311840 const h_path = other.getOutputHPath();
18321841 try zig_args.append("-isystem");
18331842 try zig_args.append(fs.path.dirname(h_path).?);