From 08de44303033cc5ad966f4e75a7fa4a3cb06635f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 26 Aug 2019 10:02:18 +0200 Subject: Implement updating build system modules --- libbuild2/target.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libbuild2/target.cxx') 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 +#include // strcmp() + #include #include #include @@ -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) -- cgit v1.1