aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/prerequisite.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-08-22 14:38:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-08-23 18:14:07 +0200
commit5035f4ef68922ac758b1e4734e67d73c9228010b (patch)
tree271fdd5b1d6e995a058d97aacb3ac90a538d9ff1 /libbuild2/prerequisite.hxx
parent8793941652d6aa1c3d02b2f87f691e6d06254b7d (diff)
Introduce notion of build context
All non-const global state is now in class context and we can now have multiple independent builds going on at the same time.
Diffstat (limited to 'libbuild2/prerequisite.hxx')
-rw-r--r--libbuild2/prerequisite.hxx38
1 files changed, 3 insertions, 35 deletions
diff --git a/libbuild2/prerequisite.hxx b/libbuild2/prerequisite.hxx
index f79ce04..fe6d10a 100644
--- a/libbuild2/prerequisite.hxx
+++ b/libbuild2/prerequisite.hxx
@@ -8,6 +8,7 @@
#include <libbuild2/types.hxx>
#include <libbuild2/utility.hxx>
+#include <libbuild2/scope.hxx>
#include <libbuild2/action.hxx>
#include <libbuild2/variable.hxx>
#include <libbuild2/target-key.hxx>
@@ -17,7 +18,6 @@
namespace build2
{
- class scope;
class target;
// Light-weight (by being shallow-pointing) prerequisite key, similar
@@ -31,7 +31,7 @@ namespace build2
class prerequisite_key
{
public:
- typedef build2::scope scope_type;
+ using scope_type = build2::scope;
const optional<project_name>& proj;
target_key tk; // The .dir and .out members can be relative.
@@ -117,7 +117,7 @@ namespace build2
name (move (n)),
ext (move (e)),
scope (s),
- vars (false /* global */) {}
+ vars (s.ctx, false /* global */) {}
// Make a prerequisite from a target.
//
@@ -192,38 +192,6 @@ namespace build2
}
using prerequisites = vector<prerequisite>;
-
- // Helpers for dealing with the prerequisite inclusion/exclusion (the
- // 'include' buildfile variable, see var_include in context.hxx).
- //
- // Note that the include(prerequisite_member) overload is also provided.
- //
- // @@ Maybe this filtering should be incorporated into *_prerequisites() and
- // *_prerequisite_members() logic? Could make normal > adhoc > excluded and
- // then pass the "threshold".
- //
- class include_type
- {
- public:
- enum value {excluded, adhoc, normal};
-
- include_type (value v): v_ (v) {}
- include_type (bool v): v_ (v ? normal : excluded) {}
-
- operator value () const {return v_;}
- explicit operator bool () const {return v_ != excluded;}
-
- private:
- value v_;
- };
-
- include_type
- include (action,
- const target&,
- const prerequisite&,
- const target* = nullptr);
}
-#include <libbuild2/prerequisite.ixx>
-
#endif // LIBBUILD2_PREREQUISITE_HXX