From 2720b45ef0ca9fd58c11fd9b4f000e1cf3a0819d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 29 Aug 2016 19:31:16 +0200 Subject: Implement initial support for library versioning Currently we only support platform-independent versions that get appended to the library name. The magic incantation is this: lib{foo}: bin.lib.version = @-1.2 This will produce libfoo-1.2.so, libfoo-1.2.dll, etc. In the future we will support things like this: lib{foo}: bin.lib.version = linux@1.2.3 freebsd@1.2 windows@1.2 --- build2/algorithm | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'build2/algorithm') diff --git a/build2/algorithm b/build2/algorithm index 651ef24..9f43475 100644 --- a/build2/algorithm +++ b/build2/algorithm @@ -233,22 +233,32 @@ namespace build2 perform_clean_depdb (action, target&); // Helper for custom perform(clean) implementations that cleans extra files - // and directories (recursively) specified as a list of extensions. The - // extension string can be NULL, in which case it is ignored. If the first - // character is '/', then the resulting path is treated as a directory - // rather than a file. Next can come zero or more '-' characters which - // indicate the number of extensions that should stripped before the new - // extension (if any) is added (so if you want to strip the extension, - // specify "-"). For example: + // and directories (recursively) specified as a list of either absolute + // paths or "path derivation directives". The directive string can be NULL, + // or empty in which case it is ignored. If the last character in a + // directive is '/', then the resulting path is treated as a directory + // rather than a file. The directive can start with zero or more '-' + // characters which indicate the number of extensions that should be + // stripped before the new extension (if any) is added (so if you want to + // strip the extension, specify just "-"). For example: // - // clean_extra (a, t, {".d", "/.dlls", "-.dll"}); + // clean_extra (a, t, {".d", ".dlls/", "-.dll"}); // // The extra files/directories are removed first in the specified order // followed by the ad hoc group member, then target itself, and, finally, // the prerequisites in the reverse order. // + // You can also clean extra files derived from adhoc group members. + // target_state - clean_extra (action, file&, initializer_list extra_ext); + clean_extra (action, file&, + initializer_list> extra); + + inline target_state + clean_extra (action a, file& f, initializer_list extra) + { + return clean_extra (a, f, {extra}); + } } #include -- cgit v1.1