File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,9 @@ public bool ValidateOptions(List<string> messages)
108
108
if ( string . IsNullOrEmpty ( options . OutputNamespace ) )
109
109
options . OutputNamespace = moduleName ;
110
110
111
+ if ( options . IncludeDirs . Count == 0 )
112
+ options . IncludeDirs . Add ( Path . GetDirectoryName ( options . HeaderFiles . First ( ) ) ) ;
113
+
111
114
SetupTargetTriple ( ) ;
112
115
113
116
return true ;
Original file line number Diff line number Diff line change @@ -439,7 +439,12 @@ public static void Run(ILibrary library)
439
439
}
440
440
441
441
new CleanUnitPass { Context = driver . Context } . VisitASTContext ( driver . Context . ASTContext ) ;
442
- options . Modules . RemoveAll ( m => m != options . SystemModule && ! m . Units . GetGenerated ( ) . Any ( ) ) ;
442
+ foreach ( var module in options . Modules . Where (
443
+ m => m != options . SystemModule && ! m . Units . GetGenerated ( ) . Any ( ) ) )
444
+ {
445
+ Diagnostics . Message ( $ "Removing module { module } because no translation units are generated...") ;
446
+ options . Modules . Remove ( module ) ;
447
+ }
443
448
444
449
if ( ! options . Quiet )
445
450
Diagnostics . Message ( "Processing code..." ) ;
Original file line number Diff line number Diff line change @@ -31,14 +31,9 @@ private Module GetModule(TranslationUnit unit)
31
31
includeDir = "." ;
32
32
includeDir = Path . GetFullPath ( includeDir ) ;
33
33
34
- Module module = Options . Modules . Find (
35
- m => m . IncludeDirs . Any ( i => Path . GetFullPath ( i ) == includeDir ) ) ;
36
- if ( module == null )
37
- {
38
- unit . ExplicitlyIgnore ( ) ;
39
- module = Options . Modules [ 1 ] ;
40
- }
41
- return module ;
34
+ return Options . Modules . FirstOrDefault (
35
+ m => m . IncludeDirs . Any ( i => Path . GetFullPath ( i ) == includeDir ) ) ??
36
+ Options . Modules [ 1 ] ;
42
37
}
43
38
44
39
public override bool VisitDeclarationContext ( DeclarationContext context )
You can’t perform that action at this time.
0 commit comments