aboutsummaryrefslogtreecommitdiff
path: root/build/prerequisite.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-01-14 11:39:21 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-01-14 11:39:21 +0200
commitce8a94e6a76097ef7eeb34df4257991a20599712 (patch)
tree5e83b9d083f486a6efe889102f7c2a815e6a06c6 /build/prerequisite.cxx
parentab4421747146aa7995f0cfb1a639c9121c82c915 (diff)
Track file extension in target, prerequisite
Diffstat (limited to 'build/prerequisite.cxx')
-rw-r--r--build/prerequisite.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/build/prerequisite.cxx b/build/prerequisite.cxx
index c43827d..370f5d0 100644
--- a/build/prerequisite.cxx
+++ b/build/prerequisite.cxx
@@ -43,7 +43,12 @@ namespace build
os << s << path::traits::directory_separator;
}
- os << p.name << '}';
+ os << p.name;
+
+ if (p.ext != nullptr)
+ os << '.' << *p.ext;
+
+ os << '}';
}
return os;
@@ -52,10 +57,19 @@ namespace build
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.directory < y.directory);
+ x.directory < y.directory) ||
+ (x.type.id == y.type.id && x.name == y.name &&
+ x.directory == y.directory &&
+ x.ext != nullptr && y.ext != nullptr && x.ext < y.ext);
}
}