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/builtin-options.ixx | 102 +++++++++++++++++++---------- 1 file changed, 66 insertions(+), 36 deletions(-) (limited to 'libbuild2/build/script/builtin-options.ixx') diff --git a/libbuild2/build/script/builtin-options.ixx b/libbuild2/build/script/builtin-options.ixx index 06575c8..c6266d0 100644 --- a/libbuild2/build/script/builtin-options.ixx +++ b/libbuild2/build/script/builtin-options.ixx @@ -176,157 +176,187 @@ namespace build2 { namespace script { - // depdb_dep_options + // depdb_dyndep_options // - inline const path& depdb_dep_options:: + inline const path& depdb_dyndep_options:: file () const { return this->file_; } - inline path& depdb_dep_options:: + inline path& depdb_dyndep_options:: file () { return this->file_; } - inline void depdb_dep_options:: + inline void depdb_dyndep_options:: file (const path& x) { this->file_ = x; } - inline bool depdb_dep_options:: + inline bool depdb_dyndep_options:: file_specified () const { return this->file_specified_; } - inline void depdb_dep_options:: + inline void depdb_dyndep_options:: file_specified (bool x) { this->file_specified_ = x; } - inline const string& depdb_dep_options:: + inline const string& depdb_dyndep_options:: format () const { return this->format_; } - inline string& depdb_dep_options:: + inline string& depdb_dyndep_options:: format () { return this->format_; } - inline void depdb_dep_options:: + inline void depdb_dyndep_options:: format (const string& x) { this->format_ = x; } - inline bool depdb_dep_options:: + inline bool depdb_dyndep_options:: format_specified () const { return this->format_specified_; } - inline void depdb_dep_options:: + inline void depdb_dyndep_options:: format_specified (bool x) { this->format_specified_ = x; } - inline const string& depdb_dep_options:: + inline const string& depdb_dyndep_options:: what () const { return this->what_; } - inline string& depdb_dep_options:: + inline string& depdb_dyndep_options:: what () { return this->what_; } - inline void depdb_dep_options:: + inline void depdb_dyndep_options:: what (const string& x) { this->what_ = x; } - inline bool depdb_dep_options:: + inline bool depdb_dyndep_options:: what_specified () const { return this->what_specified_; } - inline void depdb_dep_options:: + inline void depdb_dyndep_options:: what_specified (bool x) { this->what_specified_ = x; } - inline const dir_paths& depdb_dep_options:: + inline const dir_paths& depdb_dyndep_options:: include_path () const { return this->include_path_; } - inline dir_paths& depdb_dep_options:: + inline dir_paths& depdb_dyndep_options:: include_path () { return this->include_path_; } - inline void depdb_dep_options:: + inline void depdb_dyndep_options:: include_path (const dir_paths& x) { this->include_path_ = x; } - inline bool depdb_dep_options:: + inline bool depdb_dyndep_options:: include_path_specified () const { return this->include_path_specified_; } - inline void depdb_dep_options:: + inline void depdb_dyndep_options:: include_path_specified (bool x) { this->include_path_specified_ = x; } - inline const string& depdb_dep_options:: - default_prereq_type () const + inline const string& depdb_dyndep_options:: + default_type () const { - return this->default_prereq_type_; + return this->default_type_; } - inline string& depdb_dep_options:: - default_prereq_type () + inline string& depdb_dyndep_options:: + default_type () { - return this->default_prereq_type_; + return this->default_type_; } - inline void depdb_dep_options:: - default_prereq_type (const string& x) + inline void depdb_dyndep_options:: + default_type (const string& x) { - this->default_prereq_type_ = x; + this->default_type_ = x; } - inline bool depdb_dep_options:: - default_prereq_type_specified () const + inline bool depdb_dyndep_options:: + default_type_specified () const { - return this->default_prereq_type_specified_; + return this->default_type_specified_; } - inline void depdb_dep_options:: - default_prereq_type_specified (bool x) + inline void depdb_dyndep_options:: + default_type_specified (bool x) { - this->default_prereq_type_specified_ = x; + this->default_type_specified_ = x; + } + + inline const dir_path& depdb_dyndep_options:: + cwd () const + { + return this->cwd_; + } + + inline dir_path& depdb_dyndep_options:: + cwd () + { + return this->cwd_; + } + + inline void depdb_dyndep_options:: + cwd (const dir_path& x) + { + this->cwd_ = x; + } + + inline bool depdb_dyndep_options:: + cwd_specified () const + { + return this->cwd_specified_; + } + + inline void depdb_dyndep_options:: + cwd_specified (bool x) + { + this->cwd_specified_ = x; } } } -- cgit v1.1