diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-10-10 00:41:58 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-10-10 14:21:52 -0700 |
| commit | 14c8e270bb47c4e10ee3392661d4c62ab5c2f89d (patch) | |
| tree | c74fe79e74d3fc6bff7dd61f372153906e29e040 /lib/std/Build/Cache.zig | |
| parent | 58349b2c8ebc57718bbfbf939c30b586d5c85466 (diff) | |
| download | zig-14c8e270bb47c4e10ee3392661d4c62ab5c2f89d.tar.gz zig-14c8e270bb47c4e10ee3392661d4c62ab5c2f89d.zip | |
link: fix false positive crtbegin/crtend detection
Embrace the Path abstraction, doing more operations based on directory
handles rather than absolute file paths. Most of the diff noise here
comes from this one.
Fix sorting of crtbegin/crtend atoms. Previously it would look at all
path components for those strings.
Make the C runtime path detection partially a pure function, and move
some logic to glibc.zig where it belongs.
Diffstat (limited to 'lib/std/Build/Cache.zig')
| -rw-r--r-- | lib/std/Build/Cache.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/std/Build/Cache.zig b/lib/std/Build/Cache.zig index 93908807eb..53f1dcff29 100644 --- a/lib/std/Build/Cache.zig +++ b/lib/std/Build/Cache.zig @@ -398,12 +398,19 @@ pub const Manifest = struct { return gop.index; } + /// Deprecated, use `addOptionalFilePath`. pub fn addOptionalFile(self: *Manifest, optional_file_path: ?[]const u8) !void { self.hash.add(optional_file_path != null); const file_path = optional_file_path orelse return; _ = try self.addFile(file_path, null); } + pub fn addOptionalFilePath(self: *Manifest, optional_file_path: ?Path) !void { + self.hash.add(optional_file_path != null); + const file_path = optional_file_path orelse return; + _ = try self.addFilePath(file_path, null); + } + pub fn addListOfFiles(self: *Manifest, list_of_files: []const []const u8) !void { self.hash.add(list_of_files.len); for (list_of_files) |file_path| { |
