diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-12-01 11:11:50 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-12-03 16:48:07 +0200 |
commit | 01226d547c006d29731747c2e8c9df4f9312815e (patch) | |
tree | d6ca6269d1c514742d0fa94b77690298c3c0bf9f /libbuild2/build | |
parent | a738555f02626685f119fe332d4e2e6e9f2581f4 (diff) |
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
}}
Diffstat (limited to 'libbuild2/build')
-rw-r--r-- | libbuild2/build/script/runner.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
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<fsdir> ()) + { + // 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) |