Merge topic 'minor_cleanups'

19012b46 cmMakefile: Fix style.
10e6f1e7 cmMakefile: Fix typo in comment.
c3a2f78b Makefiles: Remove duplicate code.
2e0611f9 cmGeneratorExpression: Remove unused include.
d83ef53a Rename local 'dir_max' variables to 'dir'
This commit is contained in:
Brad King 2014-03-20 09:22:20 -04:00 committed by CMake Topic Stage
commit 9c609db988
6 changed files with 21 additions and 40 deletions

View File

@ -16,8 +16,6 @@
#include "cmStandardIncludes.h" #include "cmStandardIncludes.h"
#include "cmListFileCache.h" #include "cmListFileCache.h"
#include <stack>
#include <cmsys/RegularExpression.hxx> #include <cmsys/RegularExpression.hxx>
#include <cmsys/auto_ptr.hxx> #include <cmsys/auto_ptr.hxx>

View File

@ -639,12 +639,12 @@ void cmGlobalNinjaGenerator
cmTarget* target = gt->Target; cmTarget* target = gt->Target;
// Compute full path to object file directory for this target. // Compute full path to object file directory for this target.
std::string dir_max; std::string dir;
dir_max += gt->Makefile->GetCurrentOutputDirectory(); dir += gt->Makefile->GetCurrentOutputDirectory();
dir_max += "/"; dir += "/";
dir_max += gt->LocalGenerator->GetTargetDirectory(*target); dir += gt->LocalGenerator->GetTargetDirectory(*target);
dir_max += "/"; dir += "/";
gt->ObjectDirectory = dir_max; gt->ObjectDirectory = dir;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -111,12 +111,12 @@ cmGlobalUnixMakefileGenerator3
cmTarget* target = gt->Target; cmTarget* target = gt->Target;
// Compute full path to object file directory for this target. // Compute full path to object file directory for this target.
std::string dir_max; std::string dir;
dir_max += gt->Makefile->GetCurrentOutputDirectory(); dir += gt->Makefile->GetCurrentOutputDirectory();
dir_max += "/"; dir += "/";
dir_max += gt->LocalGenerator->GetTargetDirectory(*target); dir += gt->LocalGenerator->GetTargetDirectory(*target);
dir_max += "/"; dir += "/";
gt->ObjectDirectory = dir_max; gt->ObjectDirectory = dir;
} }
void cmGlobalUnixMakefileGenerator3::Configure() void cmGlobalUnixMakefileGenerator3::Configure()
@ -957,21 +957,6 @@ cmGlobalUnixMakefileGenerator3::RecordTargetProgress(
tp.VariableFile = tg->GetProgressFileNameFull(); tp.VariableFile = tg->GetProgressFileNameFull();
} }
//----------------------------------------------------------------------------
bool
cmGlobalUnixMakefileGenerator3::ProgressMapCompare
::operator()(cmTarget const* l, cmTarget const* r) const
{
// Order by target name.
if(int c = strcmp(l->GetName().c_str(), r->GetName().c_str()))
{
return c < 0;
}
// Order duplicate targets by binary directory.
return strcmp(l->GetMakefile()->GetCurrentOutputDirectory(),
r->GetMakefile()->GetCurrentOutputDirectory()) < 0;
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void void
cmGlobalUnixMakefileGenerator3::TargetProgress cmGlobalUnixMakefileGenerator3::TargetProgress

View File

@ -185,10 +185,8 @@ protected:
std::vector<unsigned long> Marks; std::vector<unsigned long> Marks;
void WriteProgressVariables(unsigned long total, unsigned long& current); void WriteProgressVariables(unsigned long total, unsigned long& current);
}; };
struct ProgressMapCompare { bool operator()(cmTarget const*,
cmTarget const*) const; };
typedef std::map<cmTarget const*, TargetProgress, typedef std::map<cmTarget const*, TargetProgress,
ProgressMapCompare> ProgressMapType; cmStrictTargetComparison> ProgressMapType;
ProgressMapType ProgressMap; ProgressMapType ProgressMap;
size_t CountProgressMarksInTarget(cmTarget const* target, size_t CountProgressMarksInTarget(cmTarget const* target,

View File

@ -202,11 +202,11 @@ GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
std::vector<cmSourceFile const*> objectSources; std::vector<cmSourceFile const*> objectSources;
gt->GetObjectSources(objectSources); gt->GetObjectSources(objectSources);
// Compute full path to object file directory for this target. // Compute full path to object file directory for this target.
std::string dir_max; std::string dir;
dir_max += gt->Makefile->GetCurrentOutputDirectory(); dir += gt->Makefile->GetCurrentOutputDirectory();
dir_max += "/"; dir += "/";
dir_max += this->GetTargetDirectory(*gt->Target); dir += this->GetTargetDirectory(*gt->Target);
dir_max += "/"; dir += "/";
// Compute the name of each object file. // Compute the name of each object file.
for(std::vector<cmSourceFile const*>::iterator for(std::vector<cmSourceFile const*>::iterator
si = objectSources.begin(); si = objectSources.begin();
@ -215,7 +215,7 @@ GetLocalObjectFiles(std::map<std::string, LocalObjectInfo> &localObjectFiles)
cmSourceFile const* sf = *si; cmSourceFile const* sf = *si;
bool hasSourceExtension = true; bool hasSourceExtension = true;
std::string objectName = this->GetObjectFileNameWithoutTarget(*sf, std::string objectName = this->GetObjectFileNameWithoutTarget(*sf,
dir_max, dir,
&hasSourceExtension); &hasSourceExtension);
if(cmSystemTools::FileIsFullPath(objectName.c_str())) if(cmSystemTools::FileIsFullPath(objectName.c_str()))
{ {

View File

@ -2079,7 +2079,7 @@ cmMakefile::LinearGetSourceFileWithOutput(const std::string& name) const
// does this source file have a custom command? // does this source file have a custom command?
if ((*i)->GetCustomCommand()) if ((*i)->GetCustomCommand())
{ {
// is the output of the custom command match the source files name // Does the output of the custom command match the source file name?
const std::vector<std::string>& outputs = const std::vector<std::string>& outputs =
(*i)->GetCustomCommand()->GetOutputs(); (*i)->GetCustomCommand()->GetOutputs();
for(std::vector<std::string>::const_iterator o = outputs.begin(); for(std::vector<std::string>::const_iterator o = outputs.begin();
@ -2109,7 +2109,7 @@ cmSourceFile *cmMakefile::GetSourceFileWithOutput(
// linear-time search for an output with a matching suffix. // linear-time search for an output with a matching suffix.
if(!cmSystemTools::FileIsFullPath(name.c_str())) if(!cmSystemTools::FileIsFullPath(name.c_str()))
{ {
return LinearGetSourceFileWithOutput(name); return this->LinearGetSourceFileWithOutput(name);
} }
// Otherwise we use an efficient lookup map. // Otherwise we use an efficient lookup map.
OutputToSourceMap::const_iterator o = this->OutputToSource.find(name); OutputToSourceMap::const_iterator o = this->OutputToSource.find(name);