aboutsummaryrefslogtreecommitdiff
path: root/build2/cli
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-07 08:09:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:42 +0200
commit7b9eb752cad04aaadc4552d0f26d307b04af1869 (patch)
treed19cdb450ddec384ec41d9129f8d4afecc14acb7 /build2/cli
parentbe773edfa2c8f8f3230509bbd713542d20fbb37e (diff)
Pass const target& to recipes
Diffstat (limited to 'build2/cli')
-rw-r--r--build2/cli/rule4
-rw-r--r--build2/cli/rule.cxx12
2 files changed, 8 insertions, 8 deletions
diff --git a/build2/cli/rule b/build2/cli/rule
index fbacacf..1fbbde4 100644
--- a/build2/cli/rule
+++ b/build2/cli/rule
@@ -26,10 +26,10 @@ namespace build2
apply (slock&, action, target&) const override;
static target_state
- perform_update (action, target&);
+ perform_update (action, const target&);
static target_state
- perform_clean (action, target&);
+ perform_clean (action, const target&);
};
}
}
diff --git a/build2/cli/rule.cxx b/build2/cli/rule.cxx
index 9f54950..5dcec99 100644
--- a/build2/cli/rule.cxx
+++ b/build2/cli/rule.cxx
@@ -199,7 +199,7 @@ namespace build2
}
else
{
- cli_cxx& g (*static_cast<cli_cxx*> (xt.group));
+ cli_cxx& g (static_cast<cli_cxx&> (*xt.group));
build2::match (ml, a, g);
return group_recipe; // Execute the group's recipe.
}
@@ -228,16 +228,16 @@ namespace build2
}
target_state compile::
- perform_update (action a, target& xt)
+ perform_update (action a, const target& xt)
{
- cli_cxx& t (static_cast<cli_cxx&> (xt));
+ const cli_cxx& t (static_cast<const cli_cxx&> (xt));
// Update prerequisites and determine if any relevant ones render us
// out-of-date. Note that currently we treat all the prerequisites
// as potentially affecting the result (think prologues/epilogues,
// etc).
//
- cli* s;
+ const cli* s;
{
auto p (execute_prerequisites<cli> (a, t, t.mtime ()));
@@ -320,9 +320,9 @@ namespace build2
}
target_state compile::
- perform_clean (action a, target& xt)
+ perform_clean (action a, const target& xt)
{
- cli_cxx& t (static_cast<cli_cxx&> (xt));
+ const cli_cxx& t (static_cast<const cli_cxx&> (xt));
// The reverse order of update: first delete the files, then clean
// prerequisites. Also update timestamp in case there are operations