summaryrefslogtreecommitdiffhomepage
path: root/LanguageSettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'LanguageSettings.cpp')
-rw-r--r--LanguageSettings.cpp7
1 files changed, 5 insertions, 2 deletions
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<std::filesystem::path>& 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();
}