mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
cmDepends: allow multiple dependees per depender
This patch is heavily inspired by Michael Wild.
The interfaces cmDepends::Write and cmDepends::WriteDependencies where
extended to allow multiple dependees (sources) per depender (object).
cmDepends::Write first collect all dependencies into a std::set before
passing it to cmDepends::WriteDependencies.
cmDependsC::WriteDependencies also first collects all explicit and
implicit dependencies into a std::set and only then writes
depend.{internal,make}. The implementation of cmDependsFortran simply
loops over all sources and proceeds as before, whereas the cmDependsJava
implementation is as trivial as before.
This is for preventing exponential growth of depend.{internal,make} in
the next commit which fixes dependency-vector erasure in
cmDepends::CheckDependencies.
Inspired-by: Michael Wild <themiwi@users.sourceforge.net>
This commit is contained in:
@@ -25,11 +25,11 @@ cmDependsJava::~cmDependsJava()
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmDependsJava::WriteDependencies(const char *src, const char *,
|
||||
std::ostream&, std::ostream&)
|
||||
bool cmDependsJava::WriteDependencies(const std::set<std::string>& sources,
|
||||
const std::string&, std::ostream&, std::ostream&)
|
||||
{
|
||||
// Make sure this is a scanning instance.
|
||||
if(!src || src[0] == '\0')
|
||||
if(sources.empty() || sources.begin()->empty())
|
||||
{
|
||||
cmSystemTools::Error("Cannot scan dependencies without an source file.");
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user