summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorFlorian Brosch <flo.brosch@gmail.com>2014-07-10 19:24:09 +0200
committerLuca Bruno <lucabru@src.gnome.org>2014-07-13 11:10:38 +0200
commit69b423b232f189ecb5efd28a6325ae03fa22d73e (patch)
tree78d2582d3e33be5c96da35ea45d2cc39fd881e58 /compiler
parent4cef298f02c407af235302786aafd4af14e5c88e (diff)
downloadvala-69b423b232f189ecb5efd28a6325ae03fa22d73e.tar.gz
Warn if C files are used in combination with -C
Diffstat (limited to 'compiler')
-rw-r--r--compiler/valacompiler.vala8
1 files changed, 7 insertions, 1 deletions
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 ();
}