summaryrefslogtreecommitdiff
path: root/Source/cmDependsJava.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2012-09-30 17:53:01 +0200
committerBrad King <brad.king@kitware.com>2012-11-06 11:54:39 -0500
commite74ff7c29fc764af63ed3f5195ecc64730c07939 (patch)
tree9aca0b2d414e299638ecc803dddc7c6d438e9749 /Source/cmDependsJava.cxx
parentecc77d09b8996b59bf22bc36e06fa4bb52d665ee (diff)
downloadcmake-e74ff7c29fc764af63ed3f5195ecc64730c07939.tar.gz
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>
Diffstat (limited to 'Source/cmDependsJava.cxx')
-rw-r--r--Source/cmDependsJava.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmDependsJava.cxx b/Source/cmDependsJava.cxx
index ba0e8fbe65..949d465159 100644
--- a/Source/cmDependsJava.cxx
+++ b/Source/cmDependsJava.cxx
@@ -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;