From: Florian Brosch Date: Thu, 10 Jul 2014 17:24:09 +0000 (+0200) Subject: Warn if C files are used in combination with -C X-Git-Tag: 0.25.1~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69b423b232f189ecb5efd28a6325ae03fa22d73e;p=thirdparty%2Fvala.git Warn if C files are used in combination with -C --- diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index 6583cb2e9..0ecd3cb84 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -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 (); }