Browse Source

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.
Brad King 16 years ago
parent
commit
71c0e1417b

+ 5 - 0
Source/cmCommand.h

@@ -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.

+ 1 - 0
Source/cmConfigureFileCommand.h

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

+ 1 - 0
Source/cmExportLibraryDependencies.h

@@ -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.

+ 1 - 0
Source/cmFLTKWrapUICommand.h

@@ -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.

+ 1 - 0
Source/cmInstallFilesCommand.h

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

+ 2 - 0
Source/cmInstallProgramsCommand.h

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

+ 2 - 0
Source/cmLoadCommandCommand.cxx

@@ -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.

+ 1 - 1
Source/cmMakefile.cxx

@@ -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());