From 8f8ab1e8f6d85748547c0d0e9987eed4f3c3e17b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 17 Apr 2015 15:08:05 +0200 Subject: Add support for target groups, use to handle obj/obja/objso object targets --- build/prerequisite.cxx | 48 ++++-------------------------------------------- 1 file changed, 4 insertions(+), 44 deletions(-) (limited to 'build/prerequisite.cxx') diff --git a/build/prerequisite.cxx b/build/prerequisite.cxx index 5d3235c..da6b8ba 100644 --- a/build/prerequisite.cxx +++ b/build/prerequisite.cxx @@ -16,59 +16,19 @@ using namespace std; namespace build { ostream& - operator<< (ostream& os, const prerequisite& p) + operator<< (ostream& os, const prerequisite_key& pk) { // Print scope unless the prerequisite's directory is absolute. // - if (!p.dir.absolute ()) + if (!pk.tk.dir->absolute ()) { - string s (diag_relative (p.scope.path (), false)); + string s (diag_relative (pk.scope->path (), false)); if (!s.empty ()) os << s << ':'; } - // If the name is empty, then we want to print the directory - // inside {}, e.g., dir{bar/}, not bar/dir{}. - // - bool n (!p.name.empty ()); - string d (diag_relative (p.dir, false)); - - if (n) - os << d; - - os << p.type.name << '{'; - - if (n) - { - os << p.name; - - if (p.ext != nullptr && !p.ext->empty ()) - os << '.' << *p.ext; - } - else - os << d; - - os << '}'; - - return os; - } - - bool - operator< (const prerequisite& x, const prerequisite& y) - { - //@@ TODO: use compare() to compare once. - - // Unspecified and specified extension are assumed equal. The - // extension strings are from the pool, so we can just compare - // pointers. - // - return - (x.type.id < y.type.id) || - (x.type.id == y.type.id && x.name < y.name) || - (x.type.id == y.type.id && x.name == y.name && x.dir < y.dir) || - (x.type.id == y.type.id && x.name == y.name && x.dir == y.dir && - x.ext != nullptr && y.ext != nullptr && x.ext < y.ext); + return os << pk.tk; } // prerequisite_set -- cgit v1.1