From 01226d547c006d29731747c2e8c9df4f9312815e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 1 Dec 2023 11:11:50 +0200 Subject: Make fsdir{} usable as target of ad hoc Buildscript recipes In particular, it can now be used to represent a directory symlink. For example: exe{hello}: ... fsdir{assets} fsdir{assets}: % update {{ ln -s $src_base/assets $out_base/assets }} % clean {{ rm $out_base/assets }} --- libbuild2/build/script/runner.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libbuild2/build/script') diff --git a/libbuild2/build/script/runner.cxx b/libbuild2/build/script/runner.cxx index e08ebbf..5d9764b 100644 --- a/libbuild2/build/script/runner.cxx +++ b/libbuild2/build/script/runner.cxx @@ -43,6 +43,14 @@ namespace build2 } } } + else if (const fsdir* fd = env.target.is_a ()) + { + // Compare ignoring the trailing directory separator. + // + if (path_traits::compare (i->path.string (), + fd->dir.string ()) == 0) + m = fd; + } else { for (m = &env.target; m != nullptr; m = m->adhoc_member) -- cgit v1.1