ENH: Keep only FinalPass commands in memory

In cmMakefile we save all invoked commands so that FinalPass can be
called on them later.  Most commands have no final pass, so we should
keep only the few that do.
This commit is contained in:
Brad King 2009-07-24 13:31:34 -04:00
parent 071ce33ec9
commit 71c0e1417b
8 changed files with 14 additions and 1 deletions

View File

@ -87,6 +87,11 @@ public:
* writing to the cache can be done.
*/
virtual void FinalPass() {};
/**
* Does this command have a final pass? Query after InitialPass.
*/
virtual bool HasFinalPass() const { return false; }
/**
* This is a virtual constructor for the command.

View File

@ -81,6 +81,7 @@ public:
}
virtual void FinalPass();
virtual bool HasFinalPass() const { return !this->Immediate; }
private:
int ConfigureFile();

View File

@ -48,6 +48,7 @@ public:
* specified by the command is accumulated.
*/
virtual void FinalPass();
virtual bool HasFinalPass() const { return true; }
/**
* The name of the command as specified in CMakeList.txt.

View File

@ -52,6 +52,7 @@ public:
* writing to the cache can be done.
*/
virtual void FinalPass();
virtual bool HasFinalPass() const { return true; }
/**
* The name of the command as specified in CMakeList.txt.

View File

@ -63,6 +63,7 @@ public:
* writing to the cache can be done.
*/
virtual void FinalPass();
virtual bool HasFinalPass() const { return !this->IsFilesForm; }
/**
* More documentation.

View File

@ -64,6 +64,8 @@ public:
*/
virtual void FinalPass();
virtual bool HasFinalPass() const { return true; }
/**
* More documentation.
*/

View File

@ -68,6 +68,8 @@ public:
* writing to the cache can be done.
*/
virtual void FinalPass();
virtual bool HasFinalPass() const
{ return this->info.FinalPass? true:false; }
/**
* The name of the command as specified in CMakeList.txt.

View File

@ -415,7 +415,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
cmSystemTools::SetFatalErrorOccured();
}
}
else
else if(pcmd->HasFinalPass())
{
// use the command
this->UsedCommands.push_back(pcmd.release());