build: fix WriteFile and addCSourceFiles not adding LazyPath deps
Adds a missing call to addLazyPathDependenciesOnly in std.Build.Module.addCSourceFiles. Also fixes an issue in std.Build.Step.WriteFile where it wasn't updating all the GeneratedFile instances for every directory. To fix the second issue, I removed all the GeneratedFile instances and now all files/directories reference the steps main GeneratedFile via sub paths.
This commit is contained in:
committed by
Andrew Kelley
parent
b67caf72e3
commit
d9f1a952b8
@@ -51,10 +51,11 @@ fn addExpect(
|
||||
if (mem.indexOf(u8, annotated_case_name, test_filter)) |_| break;
|
||||
} else if (self.test_filters.len > 0) return;
|
||||
|
||||
const write_src = b.addWriteFile("source.zig", source);
|
||||
const write_files = b.addWriteFiles();
|
||||
const source_zig = write_files.add("source.zig", source);
|
||||
const exe = b.addExecutable(.{
|
||||
.name = "test",
|
||||
.root_source_file = write_src.files.items[0].getPath(),
|
||||
.root_source_file = source_zig,
|
||||
.optimize = optimize_mode,
|
||||
.target = b.graph.host,
|
||||
.error_tracing = mode_config.error_tracing,
|
||||
|
||||
Reference in New Issue
Block a user