From 7b9eb752cad04aaadc4552d0f26d307b04af1869 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Feb 2017 08:09:53 +0200 Subject: Pass const target& to recipes --- build2/cli/rule | 4 ++-- build2/cli/rule.cxx | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'build2/cli') 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 (xt.group)); + cli_cxx& g (static_cast (*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 (xt)); + const cli_cxx& t (static_cast (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 (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 (xt)); + const cli_cxx& t (static_cast (xt)); // The reverse order of update: first delete the files, then clean // prerequisites. Also update timestamp in case there are operations -- cgit v1.1