diff options
| author | David Rubin <87927264+Rexicon226@users.noreply.github.com> | 2024-02-24 13:12:04 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-24 16:12:04 -0500 |
| commit | 3eacd1b2e56728a291b4e5dc443a56fa0b4cab14 (patch) | |
| tree | d66bdb000053f3bcd14844b21e08719d0ad87c40 /lib/std/Build/Module.zig | |
| parent | 70fbafacf2811a9d6db5637e91d3a165d2af84a8 (diff) | |
| download | zig-3eacd1b2e56728a291b4e5dc443a56fa0b4cab14.tar.gz zig-3eacd1b2e56728a291b4e5dc443a56fa0b4cab14.zip | |
change `addCSourceFiles` to use `LazyPath` instead `Dependency` (#19017)
Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com>
Diffstat (limited to 'lib/std/Build/Module.zig')
| -rw-r--r-- | lib/std/Build/Module.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/Build/Module.zig b/lib/std/Build/Module.zig index b481f21916..c6d908158c 100644 --- a/lib/std/Build/Module.zig +++ b/lib/std/Build/Module.zig @@ -79,9 +79,9 @@ pub const SystemLib = struct { }; pub const CSourceFiles = struct { - dependency: ?*std.Build.Dependency, - /// If `dependency` is not null relative to it, - /// else relative to the build root. + root: LazyPath, + /// `files` is relative to `root`, which is + /// the build root by default files: []const []const u8, flags: []const []const u8, }; @@ -453,9 +453,9 @@ pub fn linkFramework(m: *Module, name: []const u8, options: LinkFrameworkOptions } pub const AddCSourceFilesOptions = struct { - /// When provided, `files` are relative to `dependency` rather than the + /// When provided, `files` are relative to `root` rather than the /// package that owns the `Compile` step. - dependency: ?*std.Build.Dependency = null, + root: LazyPath = .{ .path = "" }, files: []const []const u8, flags: []const []const u8 = &.{}, }; @@ -466,7 +466,7 @@ pub fn addCSourceFiles(m: *Module, options: AddCSourceFilesOptions) void { const allocator = b.allocator; const c_source_files = allocator.create(CSourceFiles) catch @panic("OOM"); c_source_files.* = .{ - .dependency = options.dependency, + .root = options.root, .files = b.dupeStrings(options.files), .flags = b.dupeStrings(options.flags), }; |
