diff options
author | Roland Reichwein <mail@reichwein.it> | 2024-05-31 17:04:21 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2024-05-31 17:04:21 +0200 |
commit | 9b6c531505ff74f119bff6facae35c10801b2c6c (patch) | |
tree | e8efa038553588a7f4bde3f3ebe2cc3c996baf73 /LanguageSettings.cpp | |
parent | 92be2196d6515f854295b0b830ad7dd4b97bb956 (diff) |
Link dynamic lib, test
Diffstat (limited to 'LanguageSettings.cpp')
-rw-r--r-- | LanguageSettings.cpp | 7 |
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(); } |