aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Module.zig
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/Build/Module.zig')
-rw-r--r--lib/std/Build/Module.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/std/Build/Module.zig b/lib/std/Build/Module.zig
index 12cbda39a0..46c6a19578 100644
--- a/lib/std/Build/Module.zig
+++ b/lib/std/Build/Module.zig
@@ -464,6 +464,16 @@ pub const AddCSourceFilesOptions = struct {
pub fn addCSourceFiles(m: *Module, options: AddCSourceFilesOptions) void {
const b = m.owner;
const allocator = b.allocator;
+
+ for (options.files) |path| {
+ if (std.fs.path.isAbsolute(path)) {
+ std.debug.panic(
+ "file paths added with 'addCSourceFiles' must be relative, found absolute path '{s}'",
+ .{path},
+ );
+ }
+ }
+
const c_source_files = allocator.create(CSourceFiles) catch @panic("OOM");
c_source_files.* = .{
.root = options.root,