]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
valac: Add --use-fast-vapi commandline argument
authorRyan Lortie <desrt@desrt.ca>
Tue, 24 Aug 2010 17:33:50 +0000 (19:33 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 17 Sep 2010 23:00:13 +0000 (01:00 +0200)
Accepts an input file that was previously produced with the --fast-vapi=
commandline argument.

compiler/valacompiler.vala

index 1ea7499a7ab46d5a6a5151cc02b32028957860d6..bedfb86fe8e1f211fff1aa9c87bea05ae8096057 100644 (file)
@@ -38,6 +38,8 @@ class Vala.Compiler {
        static string gir;
        [CCode (array_length = false, array_null_terminated = true)]
        static string[] packages;
+       [CCode (array_length = false, array_null_terminated = true)]
+       static string[] fast_vapis;
        static string target_glib;
 
        static bool ccode_only;
@@ -98,6 +100,7 @@ class Vala.Compiler {
                { "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 },
+               { "use-fast-vapi", 0, 0, OptionArg.STRING_ARRAY, ref fast_vapis, "Use --fast-vapi output during this compile", 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" },
@@ -329,6 +332,14 @@ class Vala.Compiler {
                        }
                        packages = null;
                }
+
+               if (fast_vapis != null) {
+                       foreach (string vapi in fast_vapis) {
+                               var rpath = realpath (vapi);
+                               var source_file = new SourceFile (context, SourceFileType.FAST, rpath);
+                               context.add_source_file (source_file);
+                       }
+               }
                
                if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 0)) {
                        return quit ();
@@ -723,7 +734,7 @@ class Vala.Compiler {
                        return 0;
                }
                
-               if (sources == null) {
+               if (sources == null && fast_vapis == null) {
                        stderr.printf ("No source file specified.\n");
                        return 1;
                }