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.
@@ -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.
@@ -81,6 +81,7 @@ public:
}
virtual void FinalPass();
+ virtual bool HasFinalPass() const { return !this->Immediate; }
private:
int ConfigureFile();
@@ -48,6 +48,7 @@ public:
* specified by the command is accumulated.
+ virtual bool HasFinalPass() const { return true; }
* The name of the command as specified in CMakeList.txt.
@@ -52,6 +52,7 @@ public:
@@ -63,6 +63,7 @@ public:
+ virtual bool HasFinalPass() const { return !this->IsFilesForm; }
* More documentation.
@@ -64,6 +64,8 @@ public:
@@ -68,6 +68,8 @@ public:
+ virtual bool HasFinalPass() const
+ { return this->info.FinalPass? true:false; }
@@ -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());