]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
compiler: Add --abi-stability option for future ABI stability enablement 82bd593a41a41cebf4cfb77bf38120e1505a5184
authorDaniel Espinosa <esodan@gmail.com>
Tue, 16 Jan 2018 18:26:08 +0000 (12:26 -0600)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 20 Jan 2018 16:34:36 +0000 (17:34 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=789069

compiler/valacompiler.vala
doc/valac.1
doc/valac.h2m
vala/valacodecontext.vala

index ed97374dd3d35614011ad6d9c577a46d023b9eaa..8edb0749d5f157e1db9936f17cf45a0bbff86992 100644 (file)
@@ -53,6 +53,7 @@ class Vala.Compiler {
        static string[] gresources_directories;
 
        static bool ccode_only;
+       static bool abi_stability;
        static string header_filename;
        static bool use_header;
        static string internal_header_filename;
@@ -159,6 +160,7 @@ class Vala.Compiler {
                { "enable-version-header", 0, 0, OptionArg.NONE, ref enable_version_header, "Write vala build version in generated files", null },
                { "disable-version-header", 0, 0, OptionArg.NONE, ref disable_version_header, "Do not write vala build version in generated files", null },
                { "run-args", 0, 0, OptionArg.STRING, ref run_args, "Arguments passed to directly compiled executeable", null },
+               { "abi-stability", 0, 0, OptionArg.NONE, ref abi_stability, "Enable support for ABI stability", null },
                { OPTION_REMAINING, 0, 0, OptionArg.FILENAME_ARRAY, ref sources, null, "FILE..." },
                { null }
        };
@@ -236,6 +238,7 @@ class Vala.Compiler {
                if (ccode_only && cc_options != null) {
                        Report.warning (null, "-X has no effect when -C or --ccode is set");
                }
+               context.abi_stability = abi_stability;
                context.compile_only = compile_only;
                context.header_filename = header_filename;
                if (header_filename == null && use_header) {
index 9d0fbad773b134a5f0b798b67e5029401be99bb5..7e77a40026e969282c0496b1ab04f7af1ebb8134 100644 (file)
@@ -199,6 +199,17 @@ Do not write vala build version in generated files
 .TP
 \fB\-\-run\-args\fR
 Arguments passed to directly compiled executeable
+.TP
+\fB\-\-abi\-stability\fR
+Enable support for ABI stability
+.RS
+This changes the current behaviour to output public members of classes and
+interfaces the same order as they appear in Vala source.
+For libraries is recommended to use \fB--abi-stability\fR to ensure the
+maintainability of the resulting Application Binary Interface (ABI).
+This option is disabled by default for backward compatibility because it can
+break ABI of existing projects.
+.RE
 .SH BUGS
 https://bugzilla.gnome.org/page.cgi?id=browse.html&product=vala
 .SH "HOMEPAGE OR CONTACT"
index 87b41b7d28c9850afbe876dfee646796db17641c..15f66c2af977cdb5d1bded934b09652edee839d9 100644 (file)
@@ -23,6 +23,16 @@ or \fB--no-color\fR are declared then \fB--color\fR=\fIauto\fR is used where
 output is colored when stderr is a terminal.
 .RE
 
+/Enable support for ABI stability/
+.RS
+This changes the current behaviour to output public members of classes and
+interfaces the same order as they appear in Vala source.
+For libraries is recommended to use \fB--abi-stability\fR to ensure the
+maintainability of the resulting Application Binary Interface (ABI).
+This option is disabled by default for backward compatibility because it can
+break ABI of existing projects.
+.RE
+
 [BUGS]
 https://bugzilla.gnome.org/page.cgi?id=browse.html&product=vala
 
index ad6fcd44e3bd97fe471611be2cbc4a7152b0076d..713ba7eb21f246c910bac92ca7ccc677d392017b 100644 (file)
@@ -71,6 +71,11 @@ public class Vala.CodeContext {
         */
        public bool ccode_only { get; set; }
 
+       /**
+        * Enable support for ABI stability.
+        */
+       public bool abi_stability { get; set; }
+
        /**
         * Output C header file.
         */