diff options
author | Roland Reichwein <mail@reichwein.it> | 2024-05-18 16:31:14 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2024-05-18 16:31:14 +0200 |
commit | f857007dbb6a0a26a6828017da64540eda452fbf (patch) | |
tree | a2fc22abb236c6f07a9b9425a87b18f5f2e189f8 /file.cpp | |
parent | 8a4dfbbbe76a2aef35427b7915d6e28bab165c43 (diff) |
Link different kinds of libs
Diffstat (limited to 'file.cpp')
-rw-r--r-- | file.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -94,6 +94,19 @@ std::filesystem::path soname_short(const std::filesystem::path& p) return result; } +// e.g. +// subdir1/libxyz.so.1.2.3 -> xyz +// libabc.so -> abc +// file1.so.1 -> file1 +std::string dynamic_lib_name(const std::filesystem::path& p) +{ + std::string result {p.stem().string()}; + if (result.substr(0, 3) == "lib") { + result = result.substr(3); + } + return result; +} + bool is_static_lib(const std::filesystem::path& p) { return p.extension() == ".a"; |