diff options
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"; |