]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
valac: Add --fast-vapi= commandline argument
authorRyan Lortie <desrt@desrt.ca>
Tue, 24 Aug 2010 17:32:25 +0000 (19:32 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 17 Sep 2010 23:00:13 +0000 (01:00 +0200)
Outputs a file with the given name using CodeWriterType.FAST

compiler/valacompiler.vala

index b8a45503f1f8476d6ccd95cdf0b547959ba28c2a..1ea7499a7ab46d5a6a5151cc02b32028957860d6 100644 (file)
@@ -45,6 +45,7 @@ class Vala.Compiler {
        static bool use_header;
        static string internal_header_filename;
        static string internal_vapi_filename;
+       static string fast_vapi_filename;
        static string symbols_filename;
        static string includedir;
        static bool compile_only;
@@ -96,6 +97,7 @@ class Vala.Compiler {
                { "includedir", 0, 0, OptionArg.FILENAME, ref includedir, "Directory used to include the C header file", "DIRECTORY" },
                { "internal-header", 'h', 0, OptionArg.FILENAME, ref internal_header_filename, "Output internal C header file", "FILE" },
                { "internal-vapi", 0, 0, OptionArg.FILENAME, ref internal_vapi_filename, "Output vapi with internal api", "FILE" },
+               { "fast-vapi", 0, 0, OptionArg.STRING, ref fast_vapi_filename, "Output vapi without performing symbol resolution", null },
                { "symbols", 0, 0, OptionArg.FILENAME, ref symbols_filename, "Output symbols file", "FILE" },
                { "compile", 'c', 0, OptionArg.NONE, ref compile_only, "Compile but do not link", null },
                { "output", 'o', 0, OptionArg.FILENAME, ref output, "Place output in file FILE", "FILE" },
@@ -257,6 +259,7 @@ class Vala.Compiler {
                } else {
                        Report.error (null, "Unknown profile %s".printf (profile));
                }
+               nostdpkg |= fast_vapi_filename != null;
                context.nostdpkg = nostdpkg;
 
                context.entry_point_name = entry_point;
@@ -412,6 +415,12 @@ class Vala.Compiler {
                if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 0)) {
                        return quit ();
                }
+
+               if (fast_vapi_filename != null) {
+                       var interface_writer = new CodeWriter (CodeWriterType.FAST);
+                       interface_writer.write_file (context, fast_vapi_filename);
+                       return quit ();
+               }
                
                var resolver = new SymbolResolver ();
                resolver.resolve (context);