Fix bugzilla issue 24669 - Make -i work with C modules (#16776)

This commit is contained in:
ryuukk 2024-08-11 13:34:17 +02:00 committed by GitHub
parent 8dabb67ee5
commit 05b2c0dfe2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,3 @@
Using the compiler flag `-i` will now properly pick up C source files
Previously you needed to manually include .c source files, it now works just like with .d files

View file

@ -138,7 +138,7 @@ extern (C++) struct Compiler
*/ */
extern(C++) static bool onImport(Module m) extern(C++) static bool onImport(Module m)
{ {
if (includeImports && m.filetype == FileType.d) if (includeImports && (m.filetype == FileType.d || m.filetype == FileType.c))
{ {
if (includeImportedModuleCheck(ModuleComponentRange( if (includeImportedModuleCheck(ModuleComponentRange(
m.md ? m.md.packages : [], m.ident, m.isPackageFile))) m.md ? m.md.packages : [], m.ident, m.isPackageFile)))

View file

@ -0,0 +1,8 @@
// ARG_SETS: -i
// PERMUTE_ARGS:
// LINK:
import imports.cstuff3;
void main()
{
int s = squared(2);
}