/// <summary> /// Creates the cache object /// </summary> /// <param name="Target">The target to create the cache for</param> /// <returns>The new instance</returns> public static FlatCPPIncludeDependencyCache Create(UEBuildTarget Target) { string CachePath = FlatCPPIncludeDependencyCache.GetDependencyCachePathForTarget(Target);; // See whether the cache file exists. FileItem Cache = FileItem.GetItemByPath(CachePath); if (Cache.bExists) { if (BuildConfiguration.bPrintPerformanceInfo) { Log.TraceInformation("Loading existing FlatCPPIncludeDependencyCache: " + Cache.AbsolutePath); } var TimerStartTime = DateTime.UtcNow; // Deserialize cache from disk if there is one. FlatCPPIncludeDependencyCache Result = Load(Cache); if (Result != null) { var TimerDuration = DateTime.UtcNow - TimerStartTime; if (BuildConfiguration.bPrintPerformanceInfo) { Log.TraceInformation("Loading FlatCPPIncludeDependencyCache took " + TimerDuration.TotalSeconds + "s"); } return(Result); } } // Fall back to a clean cache on error or non-existence. return(new FlatCPPIncludeDependencyCache(Cache)); }
/// <summary> /// Creates the cache object /// </summary> /// <param name="Target">The target to create the cache for</param> /// <returns>The new instance</returns> public static FlatCPPIncludeDependencyCache Create(UEBuildTarget Target) { string CachePath = FlatCPPIncludeDependencyCache.GetDependencyCachePathForTarget(Target);; // See whether the cache file exists. FileItem Cache = FileItem.GetItemByPath(CachePath); if (Cache.bExists) { if (BuildConfiguration.bPrintPerformanceInfo) { Log.TraceInformation("Loading existing FlatCPPIncludeDependencyCache: " + Cache.AbsolutePath); } var TimerStartTime = DateTime.UtcNow; // Deserialize cache from disk if there is one. FlatCPPIncludeDependencyCache Result = Load(Cache); if (Result != null) { var TimerDuration = DateTime.UtcNow - TimerStartTime; if (BuildConfiguration.bPrintPerformanceInfo) { Log.TraceInformation("Loading FlatCPPIncludeDependencyCache took " + TimerDuration.TotalSeconds + "s"); } return(Result); } } bool bIsBuilding = (ProjectFileGenerator.bGenerateProjectFiles == false) && (BuildConfiguration.bXGEExport == false) && (UEBuildConfiguration.bGenerateManifest == false) && (UEBuildConfiguration.bGenerateExternalFileList == false) && (UEBuildConfiguration.bCleanProject == false); if (bIsBuilding && !UnrealBuildTool.bNeedsFullCPPIncludeRescan) { UnrealBuildTool.bNeedsFullCPPIncludeRescan = true; Log.TraceInformation("Performing full C++ include scan (no include cache file)"); } // Fall back to a clean cache on error or non-existence. return(new FlatCPPIncludeDependencyCache(Cache)); }