<p></p>
<p><b>@joto</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/osm2pgsql/pull/1168#discussion_r425257167">src/osm2pgsql.cpp</a>:</p>
<pre style='color:#555'>> @@ -63,7 +63,17 @@ int main(int argc, char *argv[])
auto const outputs =
output_t::create_outputs(middle->get_query_instance(), options);
- osmdata_t osmdata{middle, outputs};
+ bool const need_dependencies =
+ std::any_of(outputs.cbegin(), outputs.cend(),
+ [](std::shared_ptr<output_t> const &output) {
+ return output->need_forward_dependencies();
+ });
+
+ auto dependency_manager = std::unique_ptr<dependency_manager_t>(
+ need_dependencies ? new full_dependency_manager_t{middle.get()}
+ : new dependency_manager_t{});
+
+ osmdata_t osmdata{dependency_manager.get(), middle, outputs};
</pre>
<p>Currently the dependency manager doesn't need any configuration. But if it does in the future, so I think it is better created here where the options are available.</p>
<p>Moving into osmdata would be possible, just as with middle and outputs. That's certainly something to consider, but I'd rather do all of them or none of them.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/pull/1168#discussion_r425257167">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353VXWJTY6MGPTCTG6F3RRQJV5ANCNFSM4M7BTDNQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353TGRLOBWQGCV4KILETRRQJV5A5CNFSM4M7BTDN2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGODCHAPTY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/pull/1168#discussion_r425257167",
"url": "https://github.com/openstreetmap/osm2pgsql/pull/1168#discussion_r425257167",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>