aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Module.zig
diff options
context:
space:
mode:
authorCarl Åstholm <carl@astholm.se>2024-03-03 16:22:11 +0100
committerCarl Åstholm <carl@astholm.se>2024-04-07 15:34:46 +0200
commit2c7be4f8dd55653be6cbf5d06f8f9c47e8d9276e (patch)
tree0a032fe065a1e973952b400a44ad7654593852b4 /lib/std/Build/Module.zig
parentce71eb31dadd255b0560e4c7a837e255e0617a91 (diff)
downloadzig-2c7be4f8dd55653be6cbf5d06f8f9c47e8d9276e.tar.gz
zig-2c7be4f8dd55653be6cbf5d06f8f9c47e8d9276e.zip
Create an include tree of installed headers for dependent modules
Diffstat (limited to 'lib/std/Build/Module.zig')
-rw-r--r--lib/std/Build/Module.zig17
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/std/Build/Module.zig b/lib/std/Build/Module.zig
index b8b6560019..8937f21e88 100644
--- a/lib/std/Build/Module.zig
+++ b/lib/std/Build/Module.zig
@@ -265,8 +265,7 @@ 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) |header|
- addLazyPathDependenciesOnly(m, header.source.path());
+ addLazyPathDependenciesOnly(m, compile.getEmittedIncludeTree());
},
.static_path,
@@ -693,14 +692,9 @@ pub fn appendZigProcessFlags(
if (other.generated_h) |header| {
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) });
- },
- };
+ if (other.installed_headers_include_tree) |include_tree| {
+ try zig_args.appendSlice(&.{ "-I", include_tree.generated_directory.getPath() });
+ }
},
.config_header_step => |config_header| {
try zig_args.appendSlice(&.{ "-I", std.fs.path.dirname(config_header.output_file.getPath()).? });
@@ -751,8 +745,7 @@ 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) |header|
- addLazyPathDependenciesOnly(m, header.source.path());
+ addLazyPathDependenciesOnly(m, other.getEmittedIncludeTree());
}
fn requireKnownTarget(m: *Module) std.Target {