From 92be2196d6515f854295b0b830ad7dd4b97bb956 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 31 May 2024 15:21:50 +0200 Subject: Build static libs as dependencies --- Builder.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Builder.cpp') 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> 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 deps{get_objects(list)}; + std::vector 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> Builder::get_dependencies(co if (include_sources) { // add source dependencies of *.o - std::vector sources{get_sources(element.second)}; + std::vector sources{get_sources(list)}; for (const auto& p: sources) { fs::path p_obj{p}; p_obj.replace_extension("o"); -- cgit v1.2.3