| ... | ... | @@ -464,6 +464,16 @@ pub const AddCSourceFilesOptions = struct { |
| 464 | 464 | pub fn addCSourceFiles(m: *Module, options: AddCSourceFilesOptions) void { |
| 465 | 465 | const b = m.owner; |
| 466 | 466 | const allocator = b.allocator; |
| 467 | |
| 468 | for (options.files) |path| { |
| 469 | if (std.fs.path.isAbsolute(path)) { |
| 470 | std.debug.panic( |
| 471 | "file paths added with 'addCSourceFiles' must be relative, found absolute path '{s}'", |
| 472 | .{path}, |
| 473 | ); |
| 474 | } |
| 475 | } |
| 476 | |
| 467 | 477 | const c_source_files = allocator.create(CSourceFiles) catch @panic("OOM"); |
| 468 | 478 | c_source_files.* = .{ |
| 469 | 479 | .root = options.root, |