aboutsummaryrefslogtreecommitdiff
path: root/build/utility
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/utility
parentab4421747146aa7995f0cfb1a639c9121c82c915 (diff)
Track file extension in target, prerequisite
Diffstat (limited to 'build/utility')
-rw-r--r--build/utility13
1 files changed, 13 insertions, 0 deletions
diff --git a/build/utility b/build/utility
index bef6335..bcbf834 100644
--- a/build/utility
+++ b/build/utility
@@ -5,8 +5,11 @@
#ifndef BUILD_UTILITY
#define BUILD_UTILITY
+#include <string>
+#include <unordered_set>
#include <cstring> // strcmp
+
namespace build
{
struct compare_c_string
@@ -22,6 +25,16 @@ namespace build
template <typename P>
bool operator() (const P& x, const P& y) const {return *x < *y;}
};
+
+ // Pools (@@ perhaps move into a separate header).
+ //
+ struct string_pool: std::unordered_set<std::string>
+ {
+ const std::string&
+ find (const char* s) {return *emplace (s).first;}
+ };
+
+ extern string_pool extension_pool;
}
#endif // BUILD_UTILITY