| ... | ... | @@ -3448,7 +3448,7 @@ pub fn addCCArgs( |
| 3448 | 3448 | try argv.appendSlice(&[_][]const u8{ "-target", llvm_triple }); |
| 3449 | 3449 | |
| 3450 | 3450 | switch (ext) { |
| 3451 | | .c, .cpp, .m, .mm, .h => { |
| 3451 | .c, .cpp, .m, .mm, .h, .cuda => { |
| 3452 | 3452 | try argv.appendSlice(&[_][]const u8{ |
| 3453 | 3453 | "-nostdinc", |
| 3454 | 3454 | "-fno-spell-checking", |
| ... | ... | @@ -3747,6 +3747,7 @@ fn failCObjWithOwnedErrorMsg( |
| 3747 | 3747 | pub const FileExt = enum { |
| 3748 | 3748 | c, |
| 3749 | 3749 | cpp, |
| 3750 | cuda, |
| 3750 | 3751 | h, |
| 3751 | 3752 | m, |
| 3752 | 3753 | mm, |
| ... | ... | @@ -3761,7 +3762,7 @@ pub const FileExt = enum { |
| 3761 | 3762 | |
| 3762 | 3763 | pub fn clangSupportsDepFile(ext: FileExt) bool { |
| 3763 | 3764 | return switch (ext) { |
| 3764 | | .c, .cpp, .h, .m, .mm => true, |
| 3765 | .c, .cpp, .h, .m, .mm, .cuda => true, |
| 3765 | 3766 | |
| 3766 | 3767 | .ll, |
| 3767 | 3768 | .bc, |
| ... | ... | @@ -3792,10 +3793,11 @@ pub fn hasCppExt(filename: []const u8) bool { |
| 3792 | 3793 | return mem.endsWith(u8, filename, ".C") or |
| 3793 | 3794 | mem.endsWith(u8, filename, ".cc") or |
| 3794 | 3795 | mem.endsWith(u8, filename, ".cpp") or |
| 3795 | | mem.endsWith(u8, filename, ".cxx") or |
| 3796 | | mem.endsWith(u8, filename, ".cu") or |
| 3797 | | // .stub files are compiled by nvcc when using `zig c++` as the host compiler. They contain C++ code. |
| 3798 | | mem.endsWith(u8, filename, ".stub"); |
| 3796 | mem.endsWith(u8, filename, ".cxx"); |
| 3797 | } |
| 3798 | |
| 3799 | pub fn hasCudaExt(filename: []const u8) bool { |
| 3800 | return mem.endsWith(u8, filename, ".cu") or mem.endsWith(u8, filename, ".stub"); |
| 3799 | 3801 | } |
| 3800 | 3802 | |
| 3801 | 3803 | pub fn hasObjCExt(filename: []const u8) bool { |
| ... | ... | @@ -3862,6 +3864,8 @@ pub fn classifyFileExt(filename: []const u8) FileExt { |
| 3862 | 3864 | return .static_library; |
| 3863 | 3865 | } else if (hasObjectExt(filename)) { |
| 3864 | 3866 | return .object; |
| 3867 | } else if (hasCudaExt(filename)) { |
| 3868 | return .cuda; |
| 3865 | 3869 | } else { |
| 3866 | 3870 | return .unknown; |
| 3867 | 3871 | } |