diff options
Diffstat (limited to 'libbuild2/dist/module.hxx')
-rw-r--r-- | libbuild2/dist/module.hxx | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/libbuild2/dist/module.hxx b/libbuild2/dist/module.hxx index 95dbc53..da97939 100644 --- a/libbuild2/dist/module.hxx +++ b/libbuild2/dist/module.hxx @@ -10,21 +10,44 @@ #include <libbuild2/module.hxx> #include <libbuild2/variable.hxx> +#include <libbuild2/dist/types.hxx> + #include <libbuild2/export.hxx> namespace build2 { namespace dist { - struct LIBBUILD2_SYMEXPORT module: build2::module + class LIBBUILD2_SYMEXPORT module: public build2::module { + public: static const string name; const variable& var_dist_package; + // If exists, add the specified source file to the distribution. The + // last component in the path may be a wildcard pattern in which case + // all the files matching this pattern are added. The file path must be + // relative to the source root. + // + // Note that the file may still be explicitly excluded by a buildfile. + // + // Note also that the patterns in the last component restriction is due + // to symlink trickiness. + // + void + add_adhoc (path f) + { + adhoc.push_back (move (f)); + } + + // List of postponed prerequisites (see rule for details). + // + mutable postponed_prerequisites postponed; + // Distribution post-processing callbacks. // - // The last component in the pattern may contain shell wildcards. If the + // Only the last component in the pattern may contain wildcards. If the // path contains a directory, then it is matched from the distribution // root only. Otherwise, it is matched against all the files being // distributed. For example: @@ -40,6 +63,9 @@ namespace build2 // Note that if registered, the callbacks are also called (recursively) // in subprojects. // + // Note also that in the bootstrap distribution mode only callbacks + // registered during bootstrap will be called. + // using callback_func = void (const path&, const scope&, void*); void @@ -50,10 +76,13 @@ namespace build2 // Implementation details. // - module (const variable& v_d_p) - : var_dist_package (v_d_p) {} + public: + module (const variable& v_d_p): var_dist_package (v_d_p) {} public: + bool distributed = false; // True if this project is being distributed. + vector<path> adhoc; + struct callback { const path pattern; |