diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-04-07 15:07:00 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-07 15:07:00 -0700 |
| commit | fdd6c31e8b25f9eed81c1e78fa71eca17fd29f68 (patch) | |
| tree | 61686eb9bc1399946d702e2fe024b6bf259f5b44 /lib/std/Build.zig | |
| parent | c78f996ff986b8843f328e1f083547c538ac865b (diff) | |
| parent | eee5400b7dc37845ea5f42e0841320953e7852b2 (diff) | |
| download | zig-fdd6c31e8b25f9eed81c1e78fa71eca17fd29f68.tar.gz zig-fdd6c31e8b25f9eed81c1e78fa71eca17fd29f68.zip | |
Merge pull request #19167 from castholm/installHeader
std.Build: fix `Compile.installHeader` behavior, add `WriteFile.addCopyDirectory`
Diffstat (limited to 'lib/std/Build.zig')
| -rw-r--r-- | lib/std/Build.zig | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/std/Build.zig b/lib/std/Build.zig index 5db70d5491..50aa5c504c 100644 --- a/lib/std/Build.zig +++ b/lib/std/Build.zig @@ -1568,23 +1568,24 @@ pub fn addObjCopy(b: *Build, source: LazyPath, options: Step.ObjCopy.Options) *S return Step.ObjCopy.create(b, source, options); } -///`dest_rel_path` is relative to install prefix path -pub fn addInstallFile(self: *Build, source: LazyPath, dest_rel_path: []const u8) *Step.InstallFile { - return self.addInstallFileWithDir(source.dupe(self), .prefix, dest_rel_path); +/// `dest_rel_path` is relative to install prefix path +pub fn addInstallFile(b: *Build, source: LazyPath, dest_rel_path: []const u8) *Step.InstallFile { + return b.addInstallFileWithDir(source, .prefix, dest_rel_path); } -///`dest_rel_path` is relative to bin path -pub fn addInstallBinFile(self: *Build, source: LazyPath, dest_rel_path: []const u8) *Step.InstallFile { - return self.addInstallFileWithDir(source.dupe(self), .bin, dest_rel_path); +/// `dest_rel_path` is relative to bin path +pub fn addInstallBinFile(b: *Build, source: LazyPath, dest_rel_path: []const u8) *Step.InstallFile { + return b.addInstallFileWithDir(source, .bin, dest_rel_path); } -///`dest_rel_path` is relative to lib path -pub fn addInstallLibFile(self: *Build, source: LazyPath, dest_rel_path: []const u8) *Step.InstallFile { - return self.addInstallFileWithDir(source.dupe(self), .lib, dest_rel_path); +/// `dest_rel_path` is relative to lib path +pub fn addInstallLibFile(b: *Build, source: LazyPath, dest_rel_path: []const u8) *Step.InstallFile { + return b.addInstallFileWithDir(source, .lib, dest_rel_path); } -pub fn addInstallHeaderFile(b: *Build, src_path: []const u8, dest_rel_path: []const u8) *Step.InstallFile { - return b.addInstallFileWithDir(.{ .path = src_path }, .header, dest_rel_path); +/// `dest_rel_path` is relative to header path +pub fn addInstallHeaderFile(b: *Build, source: LazyPath, dest_rel_path: []const u8) *Step.InstallFile { + return b.addInstallFileWithDir(source, .header, dest_rel_path); } pub fn addInstallFileWithDir( @@ -1593,7 +1594,7 @@ pub fn addInstallFileWithDir( install_dir: InstallDir, dest_rel_path: []const u8, ) *Step.InstallFile { - return Step.InstallFile.create(self, source.dupe(self), install_dir, dest_rel_path); + return Step.InstallFile.create(self, source, install_dir, dest_rel_path); } pub fn addInstallDirectory(self: *Build, options: Step.InstallDir.Options) *Step.InstallDir { |
