Merge topic 'minor-cleanups'

f5b0a0fb cmMakefile: Don't pop the directory listfile off the stack.
e40fcb59 cmMakefile: Simplify convert condition.
4fdad392 cmake: Remove redundant forward declaration.
df9635f3 cmake: Remove redundant condition.
ad167479 foreach: Remove unused variables.
aaeec642 cmGlobalGenerator: De-virtualize methods with no overrides.
444bc349 Ninja: Remove some bogus comments.
This commit is contained in:
Brad King 2015-05-27 09:22:57 -04:00 committed by CMake Topic Stage
commit 95bab020b3
6 changed files with 14 additions and 38 deletions

View File

@ -44,8 +44,6 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf,
std::vector<std::string>::const_iterator j = this->Args.begin();
++j;
std::string tmps;
cmListFileArgument arg;
for( ; j != this->Args.end(); ++j)
{
// set the variable to the loop value

View File

@ -121,7 +121,7 @@ public:
* Try running cmake and building a file. This is used for dynamically
* loaded commands, not as part of the usual build process.
*/
virtual int TryCompile(const std::string& srcdir, const std::string& bindir,
int TryCompile(const std::string& srcdir, const std::string& bindir,
const std::string& projectName,
const std::string& targetName,
bool fast, std::string& output, cmMakefile* mf);
@ -371,7 +371,7 @@ protected:
typedef std::vector<cmLocalGenerator*> GeneratorVector;
// for a project collect all its targets by following depend
// information, and also collect all the targets
virtual void GetTargetSets(TargetDependSet& projectTargets,
void GetTargetSets(TargetDependSet& projectTargets,
TargetDependSet& originalTargets,
cmLocalGenerator* root, GeneratorVector const&);
bool IsRootOnlyTarget(cmTarget* target) const;
@ -446,7 +446,7 @@ protected:
TargetMap ImportedTargets;
std::vector<cmGeneratorExpressionEvaluationFile*> EvaluationFiles;
virtual const char* GetPredefinedTargetsFolder();
const char* GetPredefinedTargetsFolder();
virtual bool UseFolderProperty();
private:

View File

@ -31,28 +31,19 @@ class cmake;
class cmLocalNinjaGenerator : public cmLocalGenerator
{
public:
/// Default constructor.
cmLocalNinjaGenerator(cmGlobalGenerator* gg, cmLocalGenerator* parent);
/// Destructor.
virtual ~cmLocalNinjaGenerator();
/// Overloaded methods. @see cmLocalGenerator::Generate()
virtual void Generate();
/// Overloaded methods. @see cmLocalGenerator::Configure()
virtual void Configure();
/// Overloaded methods. @see cmLocalGenerator::GetTargetDirectory()
virtual std::string GetTargetDirectory(cmTarget const& target) const;
const cmGlobalNinjaGenerator* GetGlobalNinjaGenerator() const;
cmGlobalNinjaGenerator* GetGlobalNinjaGenerator();
/**
* Shortcut to get the cmake instance throw the global generator.
* @return an instance of the cmake object.
*/
const cmake* GetCMakeInstance() const;
cmake* GetCMakeInstance();

View File

@ -260,20 +260,11 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
else
{
cmListFileContext lfc;
if(this->ListFileStack.empty())
{
// We are not processing the project. Add the directory-level context.
lfc.FilePath = this->GetCurrentSourceDirectory();
lfc.FilePath += "/CMakeLists.txt";
}
else
{
// We are processing the project but are not currently executing a
// command. Add whatever context information we have.
lfc.FilePath = this->ListFileStack.back();
}
if(!this->CallStack.empty()
|| !this->GetCMakeInstance()->GetIsInTryCompile())
// We are not currently executing a command. Add whatever context
// information we have.
lfc.FilePath = this->ListFileStack.back();
if(!this->GetCMakeInstance()->GetIsInTryCompile())
{
lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath,
cmLocalGenerator::HOME);
@ -536,12 +527,16 @@ bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope)
{
this->AddDefinition("CMAKE_PARENT_LIST_FILE",
this->GetDefinition("CMAKE_CURRENT_LIST_FILE"));
return this->ReadListFile(listfile, noPolicyScope, false);
bool result = this->ReadListFile(listfile, noPolicyScope, false);
this->ListFileStack.pop_back();
return result;
}
bool cmMakefile::ReadListFile(const char* listfile)
{
return this->ReadListFile(listfile, true, false);
bool result = this->ReadListFile(listfile, true, false);
this->ListFileStack.pop_back();
return result;
}
bool cmMakefile::ReadListFile(const char* listfile,
@ -578,8 +573,6 @@ bool cmMakefile::ReadListFile(const char* listfile,
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_FILE");
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
this->ListFileStack.pop_back();
if (res)
{
this->CheckForUnusedVariables();

View File

@ -1620,11 +1620,6 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
std::string message = "Build files have been written to: ";
message += this->GetHomeOutputDirectory();
this->UpdateProgress(message.c_str(), -1);
if(ret)
{
return ret;
}
return ret;
}

View File

@ -30,7 +30,6 @@ class cmDocumentationSection;
class cmPolicies;
class cmTarget;
class cmGeneratedFileStream;
class cmState;
/** \brief Represents a cmake invocation.
*