| ... | ... | @@ -3854,7 +3854,7 @@ pub fn addCCArgs( |
| 3854 | 3854 | try argv.appendSlice(&[_][]const u8{ "-target", llvm_triple }); |
| 3855 | 3855 | |
| 3856 | 3856 | switch (ext) { |
| 3857 | | .c, .cpp, .m, .mm, .h => { |
| 3857 | .c, .cpp, .m, .mm, .h, .cuda => { |
| 3858 | 3858 | try argv.appendSlice(&[_][]const u8{ |
| 3859 | 3859 | "-nostdinc", |
| 3860 | 3860 | "-fno-spell-checking", |
| ... | ... | @@ -4153,6 +4153,7 @@ fn failCObjWithOwnedErrorMsg( |
| 4153 | 4153 | pub const FileExt = enum { |
| 4154 | 4154 | c, |
| 4155 | 4155 | cpp, |
| 4156 | cuda, |
| 4156 | 4157 | h, |
| 4157 | 4158 | m, |
| 4158 | 4159 | mm, |
| ... | ... | @@ -4167,7 +4168,7 @@ pub const FileExt = enum { |
| 4167 | 4168 | |
| 4168 | 4169 | pub fn clangSupportsDepFile(ext: FileExt) bool { |
| 4169 | 4170 | return switch (ext) { |
| 4170 | | .c, .cpp, .h, .m, .mm => true, |
| 4171 | .c, .cpp, .h, .m, .mm, .cuda => true, |
| 4171 | 4172 | |
| 4172 | 4173 | .ll, |
| 4173 | 4174 | .bc, |
| ... | ... | @@ -4198,10 +4199,11 @@ pub fn hasCppExt(filename: []const u8) bool { |
| 4198 | 4199 | return mem.endsWith(u8, filename, ".C") or |
| 4199 | 4200 | mem.endsWith(u8, filename, ".cc") or |
| 4200 | 4201 | mem.endsWith(u8, filename, ".cpp") or |
| 4201 | | mem.endsWith(u8, filename, ".cxx") or |
| 4202 | | mem.endsWith(u8, filename, ".cu") or |
| 4203 | | // .stub files are compiled by nvcc when using `zig c++` as the host compiler. They contain C++ code. |
| 4204 | | mem.endsWith(u8, filename, ".stub"); |
| 4202 | mem.endsWith(u8, filename, ".cxx"); |
| 4203 | } |
| 4204 | |
| 4205 | pub fn hasCudaExt(filename: []const u8) bool { |
| 4206 | return mem.endsWith(u8, filename, ".cu") or mem.endsWith(u8, filename, ".stub"); |
| 4205 | 4207 | } |
| 4206 | 4208 | |
| 4207 | 4209 | pub fn hasObjCExt(filename: []const u8) bool { |
| ... | ... | @@ -4268,6 +4270,8 @@ pub fn classifyFileExt(filename: []const u8) FileExt { |
| 4268 | 4270 | return .static_library; |
| 4269 | 4271 | } else if (hasObjectExt(filename)) { |
| 4270 | 4272 | return .object; |
| 4273 | } else if (hasCudaExt(filename)) { |
| 4274 | return .cuda; |
| 4271 | 4275 | } else { |
| 4272 | 4276 | return .unknown; |
| 4273 | 4277 | } |