diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-29 19:31:16 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-08-29 19:31:16 +0200 |
commit | 2720b45ef0ca9fd58c11fd9b4f000e1cf3a0819d (patch) | |
tree | 4505f65e4f997889e01d4b69bdf94257223d3dc6 /build2/cc/link | |
parent | 47e89b188ac71627f43e0bb8c47ffe08f6c1b919 (diff) |
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
Diffstat (limited to 'build2/cc/link')
-rw-r--r-- | build2/cc/link | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/build2/cc/link b/build2/cc/link index 52ad4a4..cd8c10e 100644 --- a/build2/cc/link +++ b/build2/cc/link @@ -37,6 +37,39 @@ namespace build2 perform_clean (action, target&) const; private: + friend class install; + + // Shared library paths. + // + struct libs_paths + { + // If any (except real) is empty, then it is the same as the next + // one. Except for intermediate, for which empty indicates that it is + // not used. + // + // The libs{} path is always the real path. On Windows the link path + // is the import library. + // + // @@ TODO: change real to reference, make other const once cache the + // object. + // + path link; // What we link: libfoo.so + path soname; // SONAME: libfoo-1.so, libfoo.so.1 + path interm; // Intermediate: libfoo.so.1.2 + const path* real; // Real: libfoo.so.1.2.3 + + inline const path& + effect_link () const {return link.empty () ? effect_soname () : link;} + + inline const path& + effect_soname () const {return soname.empty () ? *real : soname;} + }; + + libs_paths + derive_libs_paths (file&) const; + + // Library handling. + // void append_libraries (strings&, file&, bool, scope&, lorder) const; |