Esempio n. 1
0
        // UEBuildBinary interface.

        /// <summary>
        /// Called to resolve module names and uniquely bind modules to a binary.
        /// </summary>
        /// <param name="BuildTarget">The build target the modules are being bound for</param>
        /// <param name="Target">The target info</param>
        public override void BindModules()
        {
            foreach (var ModuleName in ModuleNames)
            {
                UEBuildModule Module = null;
                if (Config.bHasModuleRules)
                {
                    Module = Target.FindOrCreateModuleByName(ModuleName);
                    if (Module.Binary != null)
                    {
                        throw new BuildException("Module \"{0}\" linked into both {1} and {2}, which creates ambiguous linkage for dependents.", ModuleName, Module.Binary.Config.OutputFilePath, Config.OutputFilePath);
                    }
                    Module.Binary            = this;
                    Module.bIncludedInTarget = true;
                }

                // We set whether the binary is being compiled monolithic here to know later - specifically
                // when we are determining whether to use SharedPCHs or not for static lib builds of plugins.
                Config.bCompileMonolithic = Target.ShouldCompileMonolithic();

                // We also need to know what the actual build target configuration is later in the process
                // where we do not have access to the Target itself... This is for generating the paths
                // to the plugins.
                Config.TargetConfiguration = Target.Configuration;
                Config.TargetName          = Target.GetAppName();

                if (Module != null && (Target.Rules == null || Target.Rules.bOutputToEngineBinaries == false))
                {
                    // Fix up the binary path if this is module specifies an alternate output directory
                    for (int Index = 0; Index < Config.OutputFilePaths.Length; Index++)
                    {
                        Config.OutputFilePaths[Index] = Module.FixupOutputPath(Config.OutputFilePaths[Index]);
                    }
                }
            }
        }