]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Warn if C files are used in combination with -C
authorFlorian Brosch <flo.brosch@gmail.com>
Thu, 10 Jul 2014 17:24:09 +0000 (19:24 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Sun, 13 Jul 2014 09:10:38 +0000 (11:10 +0200)
compiler/valacompiler.vala

index 6583cb2e9c48d79c8c3780b9055026b5c7d133ac..0ecd3cb84c0aee368d47ed29967629517a32d6e1 100644 (file)
@@ -292,16 +292,22 @@ class Vala.Compiler {
                context.codegen = new GDBusServerModule ();
 
                bool has_c_files = false;
+               bool has_h_files = false;
 
                foreach (string source in sources) {
                        if (context.add_source_filename (source, run_output, true)) {
                                if (source.has_suffix (".c")) {
                                        has_c_files = true;
+                               } else if (source.has_suffix (".h")) {
+                                       has_h_files = true;
                                }
                        }
                }
                sources = null;
-               
+               if (ccode_only && (has_c_files || has_h_files)) {
+                       Report.warning (null, "C header and source files are ignored when -C or --ccode is set");
+               }
+
                if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 0)) {
                        return quit ();
                }