aboutsummaryrefslogtreecommitdiff
path: root/build/dist
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-11-30 14:39:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-11-30 14:39:07 +0200
commitd5e4d325c6a4acc8df6f0e42bc7d76e1f833d58a (patch)
treeaea61f78825f2fd6ce22a4630f6d555b4a8714c1 /build/dist
parentb2374e3174e13682fcfa3ffe3fc62f2fd161a7cc (diff)
Implement dist support for including/excluding targets
For example: cxx{*-options}: dist = true
Diffstat (limited to 'build/dist')
-rw-r--r--build/dist/module.cxx2
-rw-r--r--build/dist/operation.cxx18
-rw-r--r--build/dist/rule.cxx4
3 files changed, 19 insertions, 5 deletions
diff --git a/build/dist/module.cxx b/build/dist/module.cxx
index 0b60fa8..9bd058a 100644
--- a/build/dist/module.cxx
+++ b/build/dist/module.cxx
@@ -58,6 +58,8 @@ namespace build
//
if (first)
{
+ variable_pool.find ("dist", bool_type);
+
variable_pool.find ("dist.package", string_type);
variable_pool.find ("dist.root", dir_path_type);
diff --git a/build/dist/operation.cxx b/build/dist/operation.cxx
index 0fb3aef..2a84894 100644
--- a/build/dist/operation.cxx
+++ b/build/dist/operation.cxx
@@ -199,6 +199,7 @@ namespace build
// entered.
//
action_targets files;
+ const variable& dist_var (variable_pool.find ("dist"));
for (const auto& pt: targets)
{
@@ -211,7 +212,13 @@ namespace build
{
// Include unless explicitly excluded.
//
- files.push_back (ft);
+ auto l ((*ft)[dist_var]);
+
+ if (l && !as<bool> (*l))
+ level5 ([&]{trace << "excluding " << *ft;});
+ else
+ files.push_back (ft);
+
continue;
}
@@ -219,7 +226,14 @@ namespace build
{
// Exclude unless explicitly included.
//
- //files.push_back (*ft);
+ auto l ((*ft)[dist_var]);
+
+ if (l && as<bool> (*l))
+ {
+ level5 ([&]{trace << "including " << *ft;});
+ files.push_back (ft);
+ }
+
continue;
}
}
diff --git a/build/dist/rule.cxx b/build/dist/rule.cxx
index 6977676..b5e1185 100644
--- a/build/dist/rule.cxx
+++ b/build/dist/rule.cxx
@@ -33,11 +33,9 @@ namespace build
if (p.proj () != nullptr)
continue;
- // @@ This is where we will handle dist/nodist.
-
target& pt (p.search ());
- // Don't match targets that are outside our project.
+ // Don't match targets that are outside of our project.
//
if (pt.dir.sub (out_root))
build::match (a, pt);