[vala/staging] girwriter: Infer gir_namespace/version from target GIR filename
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] girwriter: Infer gir_namespace/version from target GIR filename
- Date: Fri, 6 Nov 2020 19:21:30 +0000 (UTC)
commit 08561731e0677ad961ec4331ec4f22eb0d7842fd
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Apr 29 16:48:55 2019 +0200
girwriter: Infer gir_namespace/version from target GIR filename
See https://gitlab.gnome.org/GNOME/vala/issues/606
codegen/valagirwriter.vala | 10 ++++++++++
1 file changed, 10 insertions(+)
---
diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index eea87bc3e..14f0819a0 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -337,6 +337,16 @@ public class Vala.GIRWriter : CodeVisitor {
return;
}
+ // Use given gir_namespace and gir_version for our top-level namespace
+ var old_gir_namespace = ns.get_attribute_string ("CCode", "gir_namespace");
+ var old_gir_version = ns.get_attribute_string ("CCode", "gir_version");
+ if ((old_gir_namespace != null && old_gir_namespace != gir_namespace)
+ || (old_gir_version != null && old_gir_version != gir_version)) {
+ Report.warning (ns.source_reference, "Replace conflicting CCode.gir_* attributes for
namespace `%s'".printf (ns.name));
+ }
+ ns.set_attribute_string ("CCode", "gir_namespace", gir_namespace);
+ ns.set_attribute_string ("CCode", "gir_version", gir_version);
+
write_c_includes (ns);
write_indent ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]