From 3bbbe09e8629ab5311a1bcbb9f56aa6a33e36f55 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 30 Nov 2022 09:08:53 +0200 Subject: Deal with order dependence in dist rule --- libbuild2/dist/types.hxx | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 libbuild2/dist/types.hxx (limited to 'libbuild2/dist/types.hxx') 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 +#include + +#include + +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 target; + reference_wrapper prereq; + }; + + struct postponed_prerequisites + { + build2::mutex mutex; + build2::list list; + }; + } +} + +#endif // LIBBUILD2_DIST_TYPES_HXX -- cgit v1.1