/// <summary> /// Generates a list of all modules referenced by this binary /// </summary> /// <param name="ReferencedBy">Map of module to the module that referenced it</param> /// <returns>List of all referenced modules</returns> public void FindModuleReferences(Dictionary <UEBuildModule, UEBuildModule> ReferencedBy) { List <UEBuildModule> ReferencedModules = new List <UEBuildModule>(); foreach (UEBuildModule Module in Modules) { ReferencedModules.Add(Module); ReferencedBy.Add(Module, null); } List <UEBuildModule> DirectlyReferencedModules = new List <UEBuildModule>(); HashSet <UEBuildModule> VisitedModules = new HashSet <UEBuildModule>(); for (int Idx = 0; Idx < ReferencedModules.Count; Idx++) { UEBuildModule SourceModule = ReferencedModules[Idx]; // Find all the direct references from this module DirectlyReferencedModules.Clear(); SourceModule.GetAllDependencyModules(DirectlyReferencedModules, VisitedModules, false, false, true); // Set up the references for all the new modules foreach (UEBuildModule DirectlyReferencedModule in DirectlyReferencedModules) { if (!ReferencedBy.ContainsKey(DirectlyReferencedModule)) { ReferencedBy.Add(DirectlyReferencedModule, SourceModule); ReferencedModules.Add(DirectlyReferencedModule); } } } }
/// <summary> /// Overrides base class to add module runtime dependencies to the build receipt. /// </summary> /// <param name="ToolChain">The platform toolchain</param> public override BuildReceipt MakeReceipt(IUEToolChain ToolChain) { BuildReceipt Receipt = base.MakeReceipt(ToolChain); // Set the IsPrecompiled flag on all the build products if we're not actually building this binary if (!Config.bAllowCompilation) { foreach (BuildProduct BuildProduct in Receipt.BuildProducts) { BuildProduct.IsPrecompiled = true; } } // Add the compiled resource file if we're building a static library containing the launch module on Windows if (Config.Type == UEBuildBinaryType.StaticLibrary && ModuleNames.Contains("Launch") && (Target.Platform == UnrealTargetPlatform.Win32 || Target.Platform == UnrealTargetPlatform.Win64)) { string ResourceFilePath = Path.Combine(Config.IntermediateDirectory, "Launch", "PCLaunch.rc.res"); Receipt.AddBuildProduct(ResourceFilePath, BuildProductType.StaticLibrary); } // Add runtime dependencies for all the modules in this binary, and build up a list of all the referenced modules Dictionary <string, UEBuildModule> ReferencedModules = new Dictionary <string, UEBuildModule>(); List <UEBuildModule> OrderedModules = new List <UEBuildModule>(); foreach (string ModuleName in ModuleNames) { UEBuildModule Module = Target.GetModuleByName(ModuleName); foreach (RuntimeDependency RuntimeDependency in Module.RuntimeDependencies) { Receipt.RuntimeDependencies.Add(new RuntimeDependency(RuntimeDependency)); } Module.GetAllDependencyModules(ReferencedModules, OrderedModules, true, false, true); } // Add runtime dependencies for all the referenced external modules. These may be introduce dependencies for the binary without actually being listed for inclusion in it. foreach (UEBuildModule OrderedModule in OrderedModules) { UEBuildExternalModule ExternalModule = OrderedModule as UEBuildExternalModule; if (ExternalModule != null) { foreach (RuntimeDependency RuntimeDependency in ExternalModule.RuntimeDependencies) { Receipt.RuntimeDependencies.Add(new RuntimeDependency(RuntimeDependency)); } } } return(Receipt); }
/// <summary> /// Overrides base class to add module runtime dependencies to the build receipt. /// </summary> /// <param name="ToolChain">The platform toolchain</param> public override BuildReceipt MakeReceipt(IUEToolChain ToolChain) { BuildReceipt Receipt = base.MakeReceipt(ToolChain); // Set the IsPrecompiled flag on all the build products if we're not actually building this binary if (!Config.bAllowCompilation) { foreach (BuildProduct BuildProduct in Receipt.BuildProducts) { BuildProduct.IsPrecompiled = true; } } // Add runtime dependencies for all the modules in this binary, and build up a list of all the referenced modules Dictionary <string, UEBuildModule> ReferencedModules = new Dictionary <string, UEBuildModule>(); List <UEBuildModule> OrderedModules = new List <UEBuildModule>(); foreach (string ModuleName in ModuleNames) { UEBuildModule Module = Target.GetModuleByName(ModuleName); foreach (RuntimeDependency RuntimeDependency in Module.RuntimeDependencies) { Receipt.RuntimeDependencies.Add(new RuntimeDependency(RuntimeDependency)); } Module.GetAllDependencyModules(ReferencedModules, OrderedModules, true, false, true); } // Add runtime dependencies for all the referenced external modules. These may be introduce dependencies for the binary without actually being listed for inclusion in it. foreach (UEBuildModule OrderedModule in OrderedModules) { UEBuildExternalModule ExternalModule = OrderedModule as UEBuildExternalModule; if (ExternalModule != null) { foreach (RuntimeDependency RuntimeDependency in ExternalModule.RuntimeDependencies) { Receipt.RuntimeDependencies.Add(new RuntimeDependency(RuntimeDependency)); } } } return(Receipt); }