diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-01-27 13:39:28 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-01-27 13:39:28 -0700 |
| commit | 0e6d2184cacf2dd1fad7508b2f9ae99d78763148 (patch) | |
| tree | 96431e859e91a817e1f0e8cc990b658a8f8bf957 /src/Compilation.zig | |
| parent | f589a66062fb99c737ab84dc5106add596cc03d4 (diff) | |
| download | zig-0e6d2184cacf2dd1fad7508b2f9ae99d78763148.tar.gz zig-0e6d2184cacf2dd1fad7508b2f9ae99d78763148.zip | |
stage2: .stub files are yet another c++ source file extension
however .cu files are a superset of c++.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 18b3aa6e76..21a0c6fe58 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -3854,7 +3854,7 @@ pub fn addCCArgs( try argv.appendSlice(&[_][]const u8{ "-target", llvm_triple }); switch (ext) { - .c, .cpp, .m, .mm, .h, .cuda => { + .c, .cpp, .m, .mm, .h, .cu => { try argv.appendSlice(&[_][]const u8{ "-nostdinc", "-fno-spell-checking", @@ -4153,7 +4153,7 @@ fn failCObjWithOwnedErrorMsg( pub const FileExt = enum { c, cpp, - cuda, + cu, h, m, mm, @@ -4168,7 +4168,7 @@ pub const FileExt = enum { pub fn clangSupportsDepFile(ext: FileExt) bool { return switch (ext) { - .c, .cpp, .h, .m, .mm, .cuda => true, + .c, .cpp, .h, .m, .mm, .cu => true, .ll, .bc, @@ -4199,11 +4199,8 @@ pub fn hasCppExt(filename: []const u8) bool { return mem.endsWith(u8, filename, ".C") or mem.endsWith(u8, filename, ".cc") or mem.endsWith(u8, filename, ".cpp") or - mem.endsWith(u8, filename, ".cxx"); -} - -pub fn hasCudaExt(filename: []const u8) bool { - return mem.endsWith(u8, filename, ".cu") or mem.endsWith(u8, filename, ".stub"); + mem.endsWith(u8, filename, ".cxx") or + mem.endsWith(u8, filename, ".stub"); } pub fn hasObjCExt(filename: []const u8) bool { @@ -4270,8 +4267,8 @@ pub fn classifyFileExt(filename: []const u8) FileExt { return .static_library; } else if (hasObjectExt(filename)) { return .object; - } else if (hasCudaExt(filename)) { - return .cuda; + } else if (mem.endsWith(u8, filename, ".cu")) { + return .cu; } else { return .unknown; } |
