Xcode: Make generation depend on all input directories

Previously the Xcode generator would rerun CMake only if input file
dependencies in the top-level directory changed.  Teach it to depend on
input files from all directories.  Other generators already do this.

Reported-by: Johan Björk <phb@spotify.com>
This commit is contained in:
Brad King 2011-01-13 12:07:23 -05:00
parent 28a0403c34
commit 809ef3086d
2 changed files with 13 additions and 4 deletions

View File

@ -355,7 +355,7 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
cmCustomCommandLines commandLines; cmCustomCommandLines commandLines;
commandLines.push_back(makecommand); commandLines.push_back(makecommand);
// Add Re-Run CMake rules // Add Re-Run CMake rules
this->CreateReRunCMakeFile(root); this->CreateReRunCMakeFile(root, gens);
// now make the allbuild depend on all the non-utility targets // now make the allbuild depend on all the non-utility targets
// in the project // in the project
@ -403,10 +403,18 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmGlobalXCodeGenerator::CreateReRunCMakeFile(cmLocalGenerator* root) void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
cmLocalGenerator* root, std::vector<cmLocalGenerator*> const& gens)
{ {
cmMakefile* mf = root->GetMakefile(); cmMakefile* mf = root->GetMakefile();
std::vector<std::string> lfiles = mf->GetListFiles(); std::vector<std::string> lfiles;
for(std::vector<cmLocalGenerator*>::const_iterator gi = gens.begin();
gi != gens.end(); ++gi)
{
std::vector<std::string> const& lf = (*gi)->GetMakefile()->GetListFiles();
lfiles.insert(lfiles.end(), lf.begin(), lf.end());
}
// sort the array // sort the array
std::sort(lfiles.begin(), lfiles.end(), std::less<std::string>()); std::sort(lfiles.begin(), lfiles.end(), std::less<std::string>());
std::vector<std::string>::iterator new_end = std::vector<std::string>::iterator new_end =

View File

@ -171,7 +171,8 @@ private:
const char* name2, const char* name2,
cmTarget& cmtarget, cmTarget& cmtarget,
const std::vector<cmCustomCommand>&); const std::vector<cmCustomCommand>&);
void CreateReRunCMakeFile(cmLocalGenerator* root); void CreateReRunCMakeFile(cmLocalGenerator* root,
std::vector<cmLocalGenerator*> const& gens);
std::string LookupFlags(const char* varNamePrefix, std::string LookupFlags(const char* varNamePrefix,
const char* varNameLang, const char* varNameLang,