From 9b6c531505ff74f119bff6facae35c10801b2c6c Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 31 May 2024 17:04:21 +0200 Subject: Link dynamic lib, test --- LanguageSettings.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'LanguageSettings.cpp') diff --git a/LanguageSettings.cpp b/LanguageSettings.cpp index 5bec072..9f3feaf 100644 --- a/LanguageSettings.cpp +++ b/LanguageSettings.cpp @@ -75,7 +75,10 @@ std::string LanguageSettings::getLinkCommand(const std::filesystem::path& target const std::vector& link_libs) const { std::string input_string{std::accumulate(inputs.begin(), inputs.end(), std::string{}, - [](const std::string& sum, const fs::path& p){ return sum + " " + p.string(); })}; + [](const std::string& sum, const fs::path& p){ + if (is_dynamic_lib(p) || is_dynamic_lib_link(p)) { return sum; } + return sum + " " + p.string(); + })}; if (is_static_lib(target)) { // link: $(AR) rcs libxyz.a x.o y.o z.o @@ -93,7 +96,7 @@ std::string LanguageSettings::getLinkCommand(const std::filesystem::path& target if (is_static_lib(i.string())) { input_string += " " + i.string(); } else if (is_dynamic_lib(i.string()) || is_dynamic_lib_link(i.string())) { - input_string += " -L" + i.parent_path().string() + " -l" + dynamic_lib_name(i); + input_string += " -L" + lib_path(i).string() + " -l" + dynamic_lib_name(i); } else { // link external dynamic lib, e.g. "fmt" link_libs_string += " -l" + i.string(); } -- cgit v1.2.3