From 70af0087d8efb3f2f7dc9ffdf2568419913f16da Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 30 Jun 2015 15:07:03 +0200 Subject: Group "see through" iteration, take 1 --- build/cli/rule | 4 ++-- build/cli/rule.cxx | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'build/cli') diff --git a/build/cli/rule b/build/cli/rule index 0f38381..d52d0e0 100644 --- a/build/cli/rule +++ b/build/cli/rule @@ -14,11 +14,11 @@ namespace build class compile: public rule { public: - virtual void* + virtual match_result match (action, target&, const std::string& hint) const; virtual recipe - apply (action, target&, void*) const; + apply (action, target&, const match_result&) const; static target_state perform_update (action, target&); diff --git a/build/cli/rule.cxx b/build/cli/rule.cxx index 6f8b648..09ef4f3 100644 --- a/build/cli/rule.cxx +++ b/build/cli/rule.cxx @@ -25,7 +25,7 @@ namespace build { using config::append_options; - void* compile:: + match_result compile:: match (action a, target& xt, const std::string&) const { tracer trace ("cli::compile::match"); @@ -36,18 +36,18 @@ namespace build // See if we have a .cli source file. // - prerequisite* r (nullptr); - for (prerequisite& p: group_prerequisites (t)) + match_result r; + for (prerequisite_member p: group_prerequisite_members (a, t)) { if (p.is_a ()) { //@@ Need to verify input and output stems match. - r = &p; + r = p; break; } } - if (r == nullptr) + if (!r) { level3 ([&]{trace << "no .cli source file for target " << t;}); return nullptr; @@ -112,12 +112,12 @@ namespace build // if (g == nullptr) { - for (prerequisite& p: group_prerequisites (t)) + for (prerequisite_member p: group_prerequisite_members (a, t)) { if (p.is_a ()) // @@ Need to check that stems match. { g = &targets.insert (t.dir, t.name, trace); - g->prerequisites.emplace_back (p); + g->prerequisites.emplace_back (p.as_prerequisite (trace)); break; } } @@ -146,7 +146,7 @@ namespace build } recipe compile:: - apply (action a, target& xt, void* vp) const + apply (action a, target& xt, const match_result& mr) const { if (cli_cxx* pt = xt.is_a ()) { @@ -182,7 +182,7 @@ namespace build } else { - cli_cxx& g (*static_cast (vp)); + cli_cxx& g (*static_cast (mr.target)); build::match (a, g); return &delegate; } -- cgit v1.1