Function addCopyFileToSource [src]

A path relative to the package root. Be careful with this because it updates source files. This should not be used as part of the normal build process, but as a utility occasionally run by a developer with intent to modify source files and then commit those changes to version control.

Prototype

pub fn addCopyFileToSource(usf: *UpdateSourceFiles, source: std.Build.LazyPath, sub_path: []const u8) void

Parameters

usf: *UpdateSourceFilessource: std.Build.LazyPathsub_path: []const u8

Source

pub fn addCopyFileToSource(usf: *UpdateSourceFiles, source: std.Build.LazyPath, sub_path: []const u8) void { const b = usf.step.owner; usf.output_source_files.append(b.allocator, .{ .contents = .{ .copy = source }, .sub_path = sub_path, }) catch @panic("OOM"); source.addStepDependencies(&usf.step); }