From 9fb791e9fad6c63fc1dac49f4d05ae63b8a3db9b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 5 Jan 2016 11:55:15 +0200 Subject: Rename build directory/namespace to build2 --- build2/dist/rule.cxx | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 build2/dist/rule.cxx (limited to 'build2/dist/rule.cxx') diff --git a/build2/dist/rule.cxx b/build2/dist/rule.cxx new file mode 100644 index 0000000..10f35f5 --- /dev/null +++ b/build2/dist/rule.cxx @@ -0,0 +1,55 @@ +// file : build2/dist/rule.cxx -*- C++ -*- +// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#include + +#include +#include +#include +#include + +using namespace std; + +namespace build2 +{ + namespace dist + { + match_result rule:: + match (action, target& t, const std::string&) const + { + return t; // We always match. + } + + recipe rule:: + apply (action a, target& t, const match_result&) const + { + const dir_path& out_root (t.root_scope ().out_path ()); + + auto r (group_prerequisite_members (a, t, false)); + for (auto i (r.begin ()); i != r.end (); ++i) + { + prerequisite_member p (*i); + + // Skip prerequisites imported from other projects. + // + if (p.proj () != nullptr) + continue; + + // If we can, go inside see-through groups. + // + if (p.type ().see_through && i.enter_group ()) + continue; + + target& pt (p.search ()); + + // Don't match targets that are outside of our project. + // + if (pt.dir.sub (out_root)) + build2::match (a, pt); + } + + return noop_recipe; // We will never be executed. + } + } +} -- cgit v1.1