summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-12-02 17:04:06 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2019-12-21 21:23:28 +0100
commit4e78d7713e80ce0b3044979e848b78229a1b6061 (patch)
tree4007f5cbb7f38eb99b61982a90381bbbdb217ec8 /compiler
parentb977da4f72503c9688725a492515c8443b2d83ae (diff)
downloadvala-4e78d7713e80ce0b3044979e848b78229a1b6061.tar.gz
compiler: Add "--depfile" option writing package dependencies to given file
This is meant to be used by build systems before invoking rebuilds
Diffstat (limited to 'compiler')
-rw-r--r--compiler/valacompiler.vala6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index 54c3535a5..174baded7 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -95,6 +95,7 @@ class Vala.Compiler {
static bool disable_colored_output;
static Report.Colored colored_output = Report.Colored.AUTO;
static string dependencies;
+ static string depfile;
static string entry_point;
@@ -126,6 +127,7 @@ class Vala.Compiler {
{ "use-fast-vapi", 0, 0, OptionArg.STRING_ARRAY, ref fast_vapis, "Use --fast-vapi output during this compile", null },
{ "vapi-comments", 0, 0, OptionArg.NONE, ref vapi_comments, "Include comments in generated vapi", null },
{ "deps", 0, 0, OptionArg.STRING, ref dependencies, "Write make-style dependency information to this file", null },
+ { "depfile", 0, 0, OptionArg.STRING, ref depfile, "Write make-style external dependency information for build systems to this file", null },
{ "list-sources", 0, 0, OptionArg.NONE, ref list_sources, "Output a list of all source and binding files which are used", 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 },
@@ -525,6 +527,10 @@ class Vala.Compiler {
context.write_dependencies (dependencies);
}
+ if (depfile != null) {
+ context.write_external_dependencies (depfile);
+ }
+
if (context.report.get_errors () > 0 || (fatal_warnings && context.report.get_warnings () > 0)) {
return quit ();
}