diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-11-30 09:08:53 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-11-30 09:08:53 +0200 |
commit | 3bbbe09e8629ab5311a1bcbb9f56aa6a33e36f55 (patch) | |
tree | f3f6ab4fc633d98ae5a215ba4529b07849ba6792 /libbuild2/dist/types.hxx | |
parent | d593b19735eec451b091fd46e4cb066e3478d6c9 (diff) |
Deal with order dependence in dist rule
Diffstat (limited to 'libbuild2/dist/types.hxx')
-rw-r--r-- | libbuild2/dist/types.hxx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libbuild2/dist/types.hxx b/libbuild2/dist/types.hxx new file mode 100644 index 0000000..f3b1009 --- /dev/null +++ b/libbuild2/dist/types.hxx @@ -0,0 +1,40 @@ +// file : libbuild2/dist/types.hxx -*- C++ -*- +// license : MIT; see accompanying LICENSE file + +#ifndef LIBBUILD2_DIST_TYPES_HXX +#define LIBBUILD2_DIST_TYPES_HXX + +#include <libbuild2/types.hxx> +#include <libbuild2/forward.hxx> + +#include <libbuild2/prerequisite-key.hxx> + +namespace build2 +{ + namespace dist + { + // List of prerequisites that could not be searched to a target and were + // postponed for later re-search. This can happen, for example, because a + // prerequisite would resolve to a member of a group that hasn't been + // matched yet (for example, libs{} of lib{}). See rule::apply() for + // details. + // + // Note that we are using list instead of vector because new elements can + // be added at the end while we are iterating over the list. + // + struct postponed_prerequisite + { + build2::action action; + reference_wrapper<const build2::target> target; + reference_wrapper<const prerequisite> prereq; + }; + + struct postponed_prerequisites + { + build2::mutex mutex; + build2::list<postponed_prerequisite> list; + }; + } +} + +#endif // LIBBUILD2_DIST_TYPES_HXX |