aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Module.zig
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/Build/Module.zig')
-rw-r--r--lib/std/Build/Module.zig30
1 files changed, 14 insertions, 16 deletions
diff --git a/lib/std/Build/Module.zig b/lib/std/Build/Module.zig
index 46c6a19578..b8b6560019 100644
--- a/lib/std/Build/Module.zig
+++ b/lib/std/Build/Module.zig
@@ -265,8 +265,8 @@ fn addShallowDependencies(m: *Module, dependee: *Module) void {
for (dependee.link_objects.items) |link_object| switch (link_object) {
.other_step => |compile| {
addStepDependencies(m, dependee, &compile.step);
- for (compile.installed_headers.items) |install_step|
- addStepDependenciesOnly(m, install_step);
+ for (compile.installed_headers.items) |header|
+ addLazyPathDependenciesOnly(m, header.source.path());
},
.static_path,
@@ -691,20 +691,19 @@ pub fn appendZigProcessFlags(
},
.other_step => |other| {
if (other.generated_h) |header| {
- try zig_args.append("-isystem");
- try zig_args.append(std.fs.path.dirname(header.path.?).?);
- }
- if (other.installed_headers.items.len > 0) {
- try zig_args.append("-I");
- try zig_args.append(b.pathJoin(&.{
- other.step.owner.install_prefix, "include",
- }));
+ try zig_args.appendSlice(&.{ "-isystem", std.fs.path.dirname(header.getPath()).? });
}
+ for (other.installed_headers.items) |header| switch (header.source) {
+ .file => |lp| {
+ try zig_args.appendSlice(&.{ "-I", std.fs.path.dirname(lp.getPath2(b, asking_step)).? });
+ },
+ .directory => |dir| {
+ try zig_args.appendSlice(&.{ "-I", dir.path.getPath2(b, asking_step) });
+ },
+ };
},
.config_header_step => |config_header| {
- const full_file_path = config_header.output_file.path.?;
- const header_dir_path = full_file_path[0 .. full_file_path.len - config_header.include_path.len];
- try zig_args.appendSlice(&.{ "-I", header_dir_path });
+ try zig_args.appendSlice(&.{ "-I", std.fs.path.dirname(config_header.output_file.getPath()).? });
},
}
}
@@ -752,9 +751,8 @@ fn linkLibraryOrObject(m: *Module, other: *Step.Compile) void {
m.link_objects.append(allocator, .{ .other_step = other }) catch @panic("OOM");
m.include_dirs.append(allocator, .{ .other_step = other }) catch @panic("OOM");
- for (other.installed_headers.items) |install_step| {
- addStepDependenciesOnly(m, install_step);
- }
+ for (other.installed_headers.items) |header|
+ addLazyPathDependenciesOnly(m, header.source.path());
}
fn requireKnownTarget(m: *Module) std.Target {