diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-26 10:02:18 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-08-26 10:02:18 +0200 |
commit | 08de44303033cc5ad966f4e75a7fa4a3cb06635f (patch) | |
tree | 090b21375b91a6b7999813d17469d20d58ab6060 /libbuild2/target.cxx | |
parent | 97e00dccb4a9d3abc3c896b33560ed6aed0a1763 (diff) |
Implement updating build system modules
Diffstat (limited to 'libbuild2/target.cxx')
-rw-r--r-- | libbuild2/target.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libbuild2/target.cxx b/libbuild2/target.cxx index dbca6cd..22f5e66 100644 --- a/libbuild2/target.cxx +++ b/libbuild2/target.cxx @@ -4,6 +4,8 @@ #include <libbuild2/target.hxx> +#include <cstring> // strcmp() + #include <libbuild2/file.hxx> #include <libbuild2/scope.hxx> #include <libbuild2/search.hxx> @@ -19,6 +21,19 @@ namespace build2 // target_type // bool target_type:: + is_a (const char* n) const + { + if (strcmp (name, n) == 0) + return true; + + for (const target_type* b (base); b != nullptr; b = b->base) + if (strcmp (b->name, n) == 0) + return true; + + return false; + } + + bool target_type:: is_a_base (const target_type& tt) const { for (const target_type* b (base); b != nullptr; b = b->base) |