diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-17 15:08:05 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-17 15:08:05 +0200 |
commit | 8f8ab1e8f6d85748547c0d0e9987eed4f3c3e17b (patch) | |
tree | 1ef9a9f271d688f1f6f2eb3fc5a8972574677433 /build/prerequisite.cxx | |
parent | 6535bf6175af32e2514faf75d2742424751a783b (diff) |
Add support for target groups, use to handle obj/obja/objso object targets
Diffstat (limited to 'build/prerequisite.cxx')
-rw-r--r-- | build/prerequisite.cxx | 48 |
1 files changed, 4 insertions, 44 deletions
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 |