aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/scope.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-01-11 14:45:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-01-15 08:52:39 +0200
commit05ee8c20d83c2f108aa71a65e19b7adff8ff9aa0 (patch)
tree34f54b78150895a1bf1c93214a0b5cfc8203dd8f /libbuild2/scope.cxx
parent1d925696ac7eb8d7adb4d70b3f5afb010d745931 (diff)
Fail with unable to import rather than unknown target type
Diffstat (limited to 'libbuild2/scope.cxx')
-rw-r--r--libbuild2/scope.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/libbuild2/scope.cxx b/libbuild2/scope.cxx
index c1c5ed7..4c9f301 100644
--- a/libbuild2/scope.cxx
+++ b/libbuild2/scope.cxx
@@ -893,9 +893,11 @@ namespace build2
}
pair<const target_type&, optional<string>> scope::
- find_prerequisite_type (name& n, name& o, const location& loc) const
+ find_prerequisite_type (name& n, name& o,
+ const location& loc,
+ const target_type* tt) const
{
- auto r (find_target_type (n, loc));
+ auto r (find_target_type (n, loc, tt));
if (r.first == nullptr)
fail (loc) << "unknown target type " << n.type << " in " << n;
@@ -919,14 +921,16 @@ namespace build2
}
prerequisite_key scope::
- find_prerequisite_key (names& ns, const location& loc) const
+ find_prerequisite_key (names& ns,
+ const location& loc,
+ const target_type* tt) const
{
if (size_t n = ns.size ())
{
if (n == (ns[0].pair ? 2 : 1))
{
name dummy;
- return find_prerequisite_key (ns[0], n == 1 ? dummy : ns[1], loc);
+ return find_prerequisite_key (ns[0], n == 1 ? dummy : ns[1], loc, tt);
}
}