]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
BaseTools: Add GenFds multi-thread support in build cache
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / ModuleAutoGen.py
index dd833208b0279ff3a45591e4885a04595d267b79..ffa4727e59eda6004f8b9d81a446a4fc52d68666 100755 (executable)
@@ -1262,11 +1262,13 @@ class ModuleAutoGen(AutoGen):
         fStringIO.close ()\r
         fInputfile.close ()\r
         return OutputName\r
+\r
     @cached_property\r
     def OutputFile(self):\r
         retVal = set()\r
         OutputDir = self.OutputDir.replace('\\', '/').strip('/')\r
         DebugDir = self.DebugDir.replace('\\', '/').strip('/')\r
+        FfsOutputDir = self.FfsOutputDir.replace('\\', '/').rstrip('/')\r
         for Item in self.CodaTargetList:\r
             File = Item.Target.Path.replace('\\', '/').strip('/').replace(DebugDir, '').replace(OutputDir, '').strip('/')\r
             retVal.add(File)\r
@@ -1282,6 +1284,12 @@ class ModuleAutoGen(AutoGen):
                 if File.lower().endswith('.pdb'):\r
                     retVal.add(File)\r
 \r
+        for Root, Dirs, Files in os.walk(FfsOutputDir):\r
+            for File in Files:\r
+                if File.lower().endswith('.ffs') or File.lower().endswith('.offset') or File.lower().endswith('.raw') \\r
+                    or File.lower().endswith('.raw.txt'):\r
+                    retVal.add(File)\r
+\r
         return retVal\r
 \r
     ## Create AsBuilt INF file the module\r
@@ -1652,13 +1660,16 @@ class ModuleAutoGen(AutoGen):
         for File in self.OutputFile:\r
             File = str(File)\r
             if not os.path.isabs(File):\r
-                File = os.path.join(self.OutputDir, File)\r
+                NewFile = os.path.join(self.OutputDir, File)\r
+                if not os.path.exists(NewFile):\r
+                    NewFile = os.path.join(self.FfsOutputDir, File)\r
+                File = NewFile\r
             if os.path.exists(File):\r
-                sub_dir = os.path.relpath(File, self.OutputDir)\r
-                destination_file = os.path.join(FileDir, sub_dir)\r
-                destination_dir = os.path.dirname(destination_file)\r
-                CreateDirectory(destination_dir)\r
-                CopyFileOnChange(File, destination_dir)\r
+                if File.lower().endswith('.ffs') or File.lower().endswith('.offset') or File.lower().endswith('.raw') \\r
+                    or File.lower().endswith('.raw.txt'):\r
+                    self.CacheCopyFile(FfsDir, self.FfsOutputDir, File)\r
+                else:\r
+                    self.CacheCopyFile(FileDir, self.OutputDir, File)\r
 \r
     def SaveHashChainFileToCache(self, gDict):\r
         if not GlobalData.gBinCacheDest:\r