aboutsummaryrefslogtreecommitdiff
path: root/lib/std/build.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-11-05 14:32:17 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-11-05 14:32:17 -0500
commit9bc4f8ea77df395b9f2407ddfa4734bb4a1c4139 (patch)
tree044ddd23f3c3babd92460ae0642b25e618b55dcc /lib/std/build.zig
parentcb8af1c6d48d5fdb26484a070b8af069c4152049 (diff)
downloadzig-9bc4f8ea77df395b9f2407ddfa4734bb4a1c4139.tar.gz
zig-9bc4f8ea77df395b9f2407ddfa4734bb4a1c4139.zip
zig build: addIncludeDir does -I instead of -isystem
Diffstat (limited to 'lib/std/build.zig')
-rw-r--r--lib/std/build.zig13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/std/build.zig b/lib/std/build.zig
index 6ef7286f9b..899e74105b 100644
--- a/lib/std/build.zig
+++ b/lib/std/build.zig
@@ -1084,6 +1084,7 @@ pub const LibExeObjStep = struct {
const IncludeDir = union(enum) {
RawPath: []const u8,
+ RawPathSystem: []const u8,
OtherStep: *LibExeObjStep,
};
@@ -1545,6 +1546,10 @@ pub const LibExeObjStep = struct {
out.print("pub const {} = {};\n", name, value) catch unreachable;
}
+ pub fn addSystemIncludeDir(self: *LibExeObjStep, path: []const u8) void {
+ self.include_dirs.append(IncludeDir{ .RawPathSystem = self.builder.dupe(path) }) catch unreachable;
+ }
+
pub fn addIncludeDir(self: *LibExeObjStep, path: []const u8) void {
self.include_dirs.append(IncludeDir{ .RawPath = self.builder.dupe(path) }) catch unreachable;
}
@@ -1823,11 +1828,15 @@ pub const LibExeObjStep = struct {
for (self.include_dirs.toSliceConst()) |include_dir| {
switch (include_dir) {
- IncludeDir.RawPath => |include_path| {
+ .RawPath => |include_path| {
+ try zig_args.append("-I");
+ try zig_args.append(self.builder.pathFromRoot(include_path));
+ },
+ .RawPathSystem => |include_path| {
try zig_args.append("-isystem");
try zig_args.append(self.builder.pathFromRoot(include_path));
},
- IncludeDir.OtherStep => |other| {
+ .OtherStep => |other| {
const h_path = other.getOutputHPath();
try zig_args.append("-isystem");
try zig_args.append(fs.path.dirname(h_path).?);