summaryrefslogtreecommitdiffhomepage
path: root/Builder.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2024-05-31 15:21:50 +0200
committerRoland Reichwein <mail@reichwein.it>2024-05-31 15:21:50 +0200
commit92be2196d6515f854295b0b830ad7dd4b97bb956 (patch)
tree41b77d8c2399d3fe2216cc1b98701aaf5446830b /Builder.cpp
parentf857007dbb6a0a26a6828017da64540eda452fbf (diff)
Build static libs as dependencies
Diffstat (limited to 'Builder.cpp')
-rw-r--r--Builder.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Builder.cpp b/Builder.cpp
index 74fbcdf..6fd4f3c 100644
--- a/Builder.cpp
+++ b/Builder.cpp
@@ -298,8 +298,12 @@ std::unordered_map<fs::path, std::vector<fs::path>> Builder::get_dependencies(co
for (const auto& element: ptree.get_child(topelement)) {
if (is_match(element, _target)) {
// add target
- fs::path target{get_target(element.second)};
- dependencies.emplace(target, get_objects(element.second));
+ const pt::ptree& list{element.second};
+ fs::path target{get_target(list)};
+ std::vector<fs::path> deps{get_objects(list)};
+ std::vector<fs::path> link_libs{link_libs_of(target)};
+ std::copy(link_libs.begin(), link_libs.end(), std::back_inserter(deps));
+ dependencies.emplace(target, deps);
// add dynamic lib links
if (is_dynamic_lib(target)) {
@@ -309,7 +313,7 @@ std::unordered_map<fs::path, std::vector<fs::path>> Builder::get_dependencies(co
if (include_sources) {
// add source dependencies of *.o
- std::vector<fs::path> sources{get_sources(element.second)};
+ std::vector<fs::path> sources{get_sources(list)};
for (const auto& p: sources) {
fs::path p_obj{p};
p_obj.replace_extension("o");