From 76f1988539c477ad3b906f254654929aec04283c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 30 Nov 2021 10:15:33 +0200 Subject: Add support for dynamic dependencies as byproduct of script body Specifically, the `depdb dyndep` builtin now has the --byproduct option (which must come first). In this mode only the --file input is supported. For example: obje{hello.o}: cxx{hello} {{ o = $path($>) t = $(o).t depdb dyndep --byproduct --what=header --default-type=h --file $t diag c++ ($<[0]) $cxx.path $cxx.poptions $cc.poptions $cc.coptions $cxx.coptions $cxx.mode -o $o -MD -MF $t -c $path($<[0]) }} Naturally, this mode does not support dynamic auto-generated prerequisites. If present, such prerequisites must be specified statically in the buildfile. Note also that the --default-prereq-type option has been rename to --default-type. --- libbuild2/build/script/script.hxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libbuild2/build/script/script.hxx') diff --git a/libbuild2/build/script/script.hxx b/libbuild2/build/script/script.hxx index 9d7567c..4e88785 100644 --- a/libbuild2/build/script/script.hxx +++ b/libbuild2/build/script/script.hxx @@ -75,7 +75,8 @@ namespace build2 // script parser for details). // bool depdb_clear; - optional depdb_dyndep; // Position of first depdb-dyndep. + optional depdb_dyndep; // Pos of first dyndep. + bool depdb_dyndep_byproduct = false; // dyndep --byproduct lines_type depdb_preamble; bool depdb_preamble_temp_dir = false; // True if refs $~. -- cgit v1.1