aboutsummaryrefslogtreecommitdiff
path: root/build/algorithm.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-17 15:08:05 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-17 15:08:05 +0200
commit8f8ab1e8f6d85748547c0d0e9987eed4f3c3e17b (patch)
tree1ef9a9f271d688f1f6f2eb3fc5a8972574677433 /build/algorithm.ixx
parent6535bf6175af32e2514faf75d2742424751a783b (diff)
Add support for target groups, use to handle obj/obja/objso object targets
Diffstat (limited to 'build/algorithm.ixx')
-rw-r--r--build/algorithm.ixx24
1 files changed, 20 insertions, 4 deletions
diff --git a/build/algorithm.ixx b/build/algorithm.ixx
index 3bc4632..5d87338 100644
--- a/build/algorithm.ixx
+++ b/build/algorithm.ixx
@@ -2,17 +2,19 @@
// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
// license : MIT; see accompanying LICENSE file
+#include <build/prerequisite>
#include <build/context>
namespace build
{
- target&
- search_impl (prerequisite&);
-
inline target&
search (prerequisite& p)
{
- return p.target != nullptr ? *p.target : search_impl (p);
+ if (p.target == nullptr)
+ p.target = &search (
+ prerequisite_key {&p.type, &p.dir, &p.name, &p.ext, &p.scope});
+
+ return *p.target;
}
void
@@ -50,4 +52,18 @@ namespace build
}
}
}
+
+ template <typename T>
+ T*
+ execute_prerequisites (action, target&, const timestamp&, bool&);
+
+ template <typename T>
+ inline T*
+ execute_prerequisites (action a, target& t, const timestamp& mt)
+ {
+ bool e (mt == timestamp_nonexistent);
+ T* r (execute_prerequisites<T> (a, t, mt, e));
+ assert (r != nullptr);
+ return e ? r : nullptr;
+ }
}