| ... | ... | @@ -569,6 +569,10 @@ pub const Builder = struct { |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | 571 | fn copyFile(self: &Builder, source_path: []const u8, dest_path: []const u8) { |
| 572 | const dirname = os.path.dirname(dest_path); |
| 573 | os.makePath(self.allocator, dirname) %% |err| { |
| 574 | debug.panic("Unable to create path {}: {}", dirname, @errorName(err)); |
| 575 | }; |
| 572 | 576 | os.copyFile(self.allocator, source_path, dest_path) %% |err| { |
| 573 | 577 | debug.panic("Unable to copy {} to {}: {}", source_path, dest_path, @errorName(err)); |
| 574 | 578 | }; |
| ... | ... | @@ -1725,11 +1729,14 @@ pub const InstallCLibraryStep = struct { |
| 1725 | 1729 | |
| 1726 | 1730 | fn make(step: &Step) -> %void { |
| 1727 | 1731 | const self = @fieldParentPtr(InstallCLibraryStep, "step", step); |
| 1732 | const builder = self.builder; |
| 1728 | 1733 | |
| 1729 | 1734 | self.builder.copyFile(self.lib.out_filename, self.dest_file); |
| 1730 | 1735 | if (!self.lib.static) { |
| 1731 | | %%os.atomicSymLink(self.builder.allocator, self.lib.out_filename, self.lib.major_only_filename); |
| 1732 | | %%os.atomicSymLink(self.builder.allocator, self.lib.major_only_filename, self.lib.name_only_filename); |
| 1736 | const dest_major_only = %%os.path.join(builder.allocator, builder.lib_dir, self.lib.major_only_filename); |
| 1737 | const dest_name_only = %%os.path.join(builder.allocator, builder.lib_dir, self.lib.name_only_filename); |
| 1738 | %%os.atomicSymLink(self.builder.allocator, self.lib.out_filename, dest_major_only); |
| 1739 | %%os.atomicSymLink(self.builder.allocator, self.lib.major_only_filename, dest_name_only); |
| 1733 | 1740 | } |
| 1734 | 1741 | } |
| 1735 | 1742 | }; |
| ... | ... | @@ -1751,8 +1758,7 @@ pub const InstallFileStep = struct { |
| 1751 | 1758 | |
| 1752 | 1759 | fn make(step: &Step) -> %void { |
| 1753 | 1760 | const self = @fieldParentPtr(InstallFileStep, "step", step); |
| 1754 | | |
| 1755 | | debug.panic("TODO install file"); |
| 1761 | self.builder.copyFile(self.src_path, self.dest_path); |
| 1756 | 1762 | } |
| 1757 | 1763 | }; |
| 1758 | 1764 | |