From f857007dbb6a0a26a6828017da64540eda452fbf Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 18 May 2024 16:31:14 +0200 Subject: Link different kinds of libs --- file.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'file.cpp') diff --git a/file.cpp b/file.cpp index 31695e5..b5cbe36 100644 --- a/file.cpp +++ b/file.cpp @@ -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"; -- cgit v1.2.3