E.g. gtk+-4.0 is *one* library with multiple namespaces and gir files. So
we need to handle this case and allow all explicitly given GIR files to be
parsed.
this.current_source_file.package_name = pkg;
if (context.has_package (pkg)) {
// package already provided elsewhere, stop parsing this GIR
- return;
+ // if it was not passed explicitly
+ if (!this.current_source_file.explicit) {
+ return;
+ }
} else {
context.add_package (pkg);
}
*/
public bool used { get; set; }
+ /**
+ * Whether this source-file was explicitly passed on the commandline.
+ */
+ public bool explicit { get; set; }
+
private ArrayList<Comment> comments = new ArrayList<Comment> ();
public List<UsingDirective> current_using_directives { get; set; default = new ArrayList<UsingDirective> (); }
foreach (string source in sources) {
if (FileUtils.test (source, FileTest.EXISTS)) {
- context.add_source_file (new SourceFile (context, SourceFileType.PACKAGE, source));
+ var source_file = new SourceFile (context, SourceFileType.PACKAGE, source);
+ source_file.explicit = true;
+ context.add_source_file (source_file);
} else {
Report.error (null, "%s not found".printf (source));
}