summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-08-07 17:57:13 (GMT)
committerBrad King <brad.king@kitware.com>2007-08-07 17:57:13 (GMT)
commitd9267920664fda123cc91894d78b06b43bdff44f (patch)
tree140e705964a74064e3e5a8e89e07cb25913a1a03 /Source/cmLocalUnixMakefileGenerator3.cxx
parent91384d7df408d988ba53f03636ed53d28b744e32 (diff)
downloadCMake-d9267920664fda123cc91894d78b06b43bdff44f.zip
CMake-d9267920664fda123cc91894d78b06b43bdff44f.tar.gz
CMake-d9267920664fda123cc91894d78b06b43bdff44f.tar.bz2
ENH: Replaced dependency integrity map with an explicit map from object file to source file for each language in each target. This simplifies creation of implicit dependency scanning rules and allows more than one object file in a target to start dependency scanning with the same source file.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx73
1 files changed, 38 insertions, 35 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 19a0034..bdddd9b 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1644,52 +1644,37 @@ void cmLocalUnixMakefileGenerator3::CheckDependencies(cmMakefile* mf,
void cmLocalUnixMakefileGenerator3
::WriteDependLanguageInfo(std::ostream& cmakefileStream, cmTarget &target)
{
- // now write all the language stuff
- // Set the set of files to check for dependency integrity.
- std::set<cmStdString> checkSetLangs;
- std::map<cmStdString,cmLocalUnixMakefileGenerator3::IntegrityCheckSet>&
- checkSet = this->GetIntegrityCheckSet()[target.GetName()];
- for(std::map<cmStdString,
- cmLocalUnixMakefileGenerator3::IntegrityCheckSet>::const_iterator
- l = checkSet.begin(); l != checkSet.end(); ++l)
- {
- checkSetLangs.insert(l->first);
- }
-
+ ImplicitDependLanguageMap const& implicitLangs =
+ this->GetImplicitDepends(target);
+
// list the languages
cmakefileStream
- << "# The set of files whose dependency integrity should be checked:\n";
+ << "# The set of languages for which implicit dependencies are needed:\n";
cmakefileStream
<< "SET(CMAKE_DEPENDS_LANGUAGES\n";
- for(std::set<cmStdString>::iterator
- l = checkSetLangs.begin(); l != checkSetLangs.end(); ++l)
+ for(ImplicitDependLanguageMap::const_iterator
+ l = implicitLangs.begin(); l != implicitLangs.end(); ++l)
{
- cmakefileStream << " \"" << l->c_str() << "\"\n";
+ cmakefileStream << " \"" << l->first.c_str() << "\"\n";
}
cmakefileStream << " )\n";
-
+
// now list the files for each language
- for(std::set<cmStdString>::iterator
- l = checkSetLangs.begin(); l != checkSetLangs.end(); ++l)
+ cmakefileStream
+ << "# The set of files for implicit dependencies of each language:\n";
+ for(ImplicitDependLanguageMap::const_iterator
+ l = implicitLangs.begin(); l != implicitLangs.end(); ++l)
{
cmakefileStream
- << "SET(CMAKE_DEPENDS_CHECK_" << l->c_str() << "\n";
- // get the check set for this local gen and language
- cmLocalUnixMakefileGenerator3::IntegrityCheckSet iCheckSet =
- checkSet[*l];
- // for each file
- for(cmLocalUnixMakefileGenerator3::IntegrityCheckSet::const_iterator
- csIter = iCheckSet.begin();
- csIter != iCheckSet.end(); ++csIter)
+ << "SET(CMAKE_DEPENDS_CHECK_" << l->first.c_str() << "\n";
+ ImplicitDependFileMap const& implicitPairs = l->second;
+
+ // for each file pair
+ for(ImplicitDependFileMap::const_iterator pi = implicitPairs.begin();
+ pi != implicitPairs.end(); ++pi)
{
- cmakefileStream << " \"" << (*csIter)->GetFullPath() << "\"\n";
- // Get the full path name of the object file.
- std::string obj = this->Makefile->GetStartOutputDirectory();
- obj += "/";
- obj += this->GetObjectFileName(target, **csIter);
- cmakefileStream << " \"" <<
- this->Convert(obj.c_str(),
- cmLocalGenerator::FULL).c_str() << "\"\n";
+ cmakefileStream << " \"" << pi->second << "\" ";
+ cmakefileStream << "\"" << pi->first << "\"\n";
}
cmakefileStream << " )\n";
}
@@ -1926,6 +1911,24 @@ cmLocalUnixMakefileGenerator3
return dir;
}
+//----------------------------------------------------------------------------
+cmLocalUnixMakefileGenerator3::ImplicitDependLanguageMap const&
+cmLocalUnixMakefileGenerator3::GetImplicitDepends(cmTarget const& tgt)
+{
+ return this->ImplicitDepends[tgt.GetName()];
+}
+
+//----------------------------------------------------------------------------
+void
+cmLocalUnixMakefileGenerator3::AddImplicitDepends(cmTarget const& tgt,
+ const char* lang,
+ const char* obj,
+ const char* src)
+{
+ this->ImplicitDepends[tgt.GetName()][lang][obj] = src;
+}
+
+//----------------------------------------------------------------------------
void cmLocalUnixMakefileGenerator3
::CreateCDCommand(std::vector<std::string>& commands, const char *tgtDir,
const char *retDir)