aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbuild2/search.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbuild2/search.cxx b/libbuild2/search.cxx
index fca19ea..d3638d7 100644
--- a/libbuild2/search.cxx
+++ b/libbuild2/search.cxx
@@ -86,6 +86,10 @@ namespace build2
const target_key& ctk (cpk.tk);
const scope* s (cpk.scope);
+ // Has to be a file target.
+ //
+ assert (ctk.type->is_a<file> ());
+
path f;
if (ctk.dir->absolute ())
@@ -191,9 +195,7 @@ namespace build2
target_decl::prereq_file,
trace));
- // Has to be a file_target.
- //
- const file& t (dynamic_cast<const file&> (r.first));
+ const file& t (r.first.as<file> ());
l5 ([&]{trace << (r.second ? "new" : "existing") << " target " << t
<< " for prerequisite " << cpk;});