当前位置: 首页>>代码示例>>C#>>正文


C# UEBuildTarget.FindOrCreateModuleByName方法代码示例

本文整理汇总了C#中UnrealBuildTool.UEBuildTarget.FindOrCreateModuleByName方法的典型用法代码示例。如果您正苦于以下问题:C# UEBuildTarget.FindOrCreateModuleByName方法的具体用法?C# UEBuildTarget.FindOrCreateModuleByName怎么用?C# UEBuildTarget.FindOrCreateModuleByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnrealBuildTool.UEBuildTarget的用法示例。


在下文中一共展示了UEBuildTarget.FindOrCreateModuleByName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RecursivelyAddIncludePathModules

        public override void RecursivelyAddIncludePathModules( UEBuildTarget Target, bool bPublicIncludesOnly )
        {
            var AllIncludePathModuleNames = new List<string>();
            AllIncludePathModuleNames.AddRange( PublicIncludePathModuleNames );
            if( !bPublicIncludesOnly )
            {
                AllIncludePathModuleNames.AddRange( PrivateIncludePathModuleNames );
            }
            foreach( var IncludePathModuleName in AllIncludePathModuleNames )
            {
                var IncludePathModule = Target.FindOrCreateModuleByName( IncludePathModuleName );

                // No need to do anything here.  We just want to make sure that we've instantiated our representation of the
                // module so that we can find it later when processing include path module names.  Unlike actual dependency
                // modules, these include path modules may never be "bound" (have Binary or bIncludedInTarget member variables set)

                // We'll also need to make sure we know about all dependent public include path modules, too!
                IncludePathModule.RecursivelyAddIncludePathModules( Target, bPublicIncludesOnly:true );
            }
        }
开发者ID:colwalder,项目名称:unrealengine,代码行数:20,代码来源:UEBuildModule.cs

示例2: RecursivelyCreateIncludePathModulesByName

		private static void RecursivelyCreateIncludePathModulesByName(UEBuildTarget Target, List<string> ModuleNames, ref List<UEBuildModule> Modules)
		{
			// Check whether the module list is already set. We set this immediately (via the ref) to avoid infinite recursion.
			if (Modules == null)
			{
				Modules = new List<UEBuildModule>();
				foreach (string ModuleName in ModuleNames)
				{
					UEBuildModule Module = Target.FindOrCreateModuleByName(ModuleName);
					RecursivelyCreateIncludePathModulesByName(Target, Module.Rules.PublicIncludePathModuleNames, ref Module.PublicIncludePathModules);
					Modules.Add(Module);
				}
			}
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:14,代码来源:UEBuildModule.cs

示例3: Compile


//.........这里部分代码省略.........
						// Shared PCH headers need to be force included, because we're basically forcing the module to use
						// the precompiled header that we want, instead of the "first include" in each respective .cpp file
						ModulePCHCompileEnvironment.Config.bForceIncludePrecompiledHeader = true;
					}

					List<FileItem> CPPFilesToBuild = SourceFilesToBuild.CPPFiles;
					if (bModuleUsesUnityBuild)
					{
						// unity files generated for only the set of files which share the same PCH environment
						CPPFilesToBuild = Unity.GenerateUnityCPPs(ToolChain, Target, CPPFilesToBuild, ModulePCHCompileEnvironment, Name);
					}

					// Check if there are enough unity files to warrant pch generation (and we haven't already generated the shared one)
					if (ModulePCHEnvironment.PrecompiledHeaderFile == null)
					{
						if (SharedPCHHeaderFile != null || CPPFilesToBuild.Count >= MinFilesUsingPrecompiledHeader)
						{
                            CPPOutput PCHOutput;
							if (SharedPCHHeaderFile == null)
							{
								PCHOutput = PrecompileHeaderEnvironment.GeneratePCHCreationAction(
									ToolChain,
									Target,
									CPPFilesToBuild[0].PCHHeaderNameInCode,
									ModulePCHEnvironment.PrecompiledHeaderIncludeFilename,
									ModuleCompileEnvironment,
									ModuleCompileEnvironment.Config.OutputDirectory,
									ModuleCompileEnvironment.Config.PCHOutputDirectory,
									Name,
									true);
							}
							else
							{
								UEBuildModuleCPP SharedPCHModule = (UEBuildModuleCPP)Target.FindOrCreateModuleByName(SharedPCHModuleName);

								CPPEnvironment SharedPCHCompileEnvironment = GlobalCompileEnvironment.DeepCopy();
								SharedPCHCompileEnvironment.Config.bEnableShadowVariableWarning = SharedPCHModule.Rules.bEnableShadowVariableWarnings;

								List<UEBuildModule> Modules = new List<UEBuildModule>();
								Dictionary<UEBuildModule, bool> ModuleToIncludePathsOnlyFlag = new Dictionary<UEBuildModule, bool>();
								SharedPCHModule.FindModulesInPublicCompileEnvironment(Modules, ModuleToIncludePathsOnlyFlag);

								foreach (UEBuildModule Module in Modules)
								{
									Module.AddModuleToCompileEnvironment(
										Binary,
										ModuleToIncludePathsOnlyFlag[Module],
										SharedPCHCompileEnvironment.Config.CPPIncludeInfo.IncludePaths,
										SharedPCHCompileEnvironment.Config.CPPIncludeInfo.SystemIncludePaths,
										SharedPCHCompileEnvironment.Config.Definitions,
										SharedPCHCompileEnvironment.Config.AdditionalFrameworks);
								}
                                
								PCHOutput = PrecompileHeaderEnvironment.GeneratePCHCreationAction(
									ToolChain,
									Target,
									CPPFilesToBuild[0].PCHHeaderNameInCode,
									ModulePCHEnvironment.PrecompiledHeaderIncludeFilename,
									SharedPCHCompileEnvironment,
									DirectoryReference.Combine(CompileEnvironment.Config.OutputDirectory, "SharedPCHs"),
									(CompileEnvironment.Config.PCHOutputDirectory == null)? null : DirectoryReference.Combine(CompileEnvironment.Config.PCHOutputDirectory, "SharedPCHs"),
									"Shared",
									false);
							}

							ModulePCHEnvironment.PrecompiledHeaderFile = PCHOutput.PrecompiledHeaderFile;
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:67,代码来源:UEBuildModule.cs

示例4: RecursivelyProcessUnboundModules

        public override void RecursivelyProcessUnboundModules(UEBuildTarget Target, ref Dictionary<string, UEBuildBinary> Binaries, UEBuildBinary ExecutableBinary)
        {
            // Make sure this module is bound to a binary
            if( !bIncludedInTarget )
            {
                throw new BuildException( "Module '{0}' should already have been bound to a binary!", Name );
            }

            var AllModuleNames = new List<string>();
            AllModuleNames.AddRange( PrivateDependencyModuleNames );
            AllModuleNames.AddRange( PublicDependencyModuleNames );
            AllModuleNames.AddRange( DynamicallyLoadedModuleNames );
            AllModuleNames.AddRange( PlatformSpecificDynamicallyLoadedModuleNames );

            foreach( var DependencyName in AllModuleNames )
            {
                var DependencyModule = Target.FindOrCreateModuleByName(DependencyName);

                // Skip modules that are included with the target (externals)
                if( !DependencyModule.bIncludedInTarget )
                {
                    if( !Binaries.ContainsKey( DependencyModule.Name ) )
                    {
                        UEBuildBinary BinaryToBindTo;
                        if (Target.ShouldCompileMonolithic())
                        {
                            // When linking monolithically, any unbound modules will be linked into the main executable
                            BinaryToBindTo = ExecutableBinary;
                        }
                        else
                        {
                            // Is this a Rocket module?
                            bool bIsRocketModule = RulesCompiler.IsRocketProjectModule(DependencyName);

                            // Is this a plugin module?
                            var PluginInfo = Plugins.GetPluginInfoForModule( DependencyName );

                            string OutputFilePath = Target.MakeBinaryPath(DependencyModule.Name, Target.GetAppName() + "-" + DependencyModule.Name, UEBuildBinaryType.DynamicLinkLibrary, Target.Rules.Type, bIsRocketModule, PluginInfo, "");

                            // If it's an engine module, output intermediates to the engine intermediates directory.
                            string IntermediateDirectory = Binary.Config.IntermediateDirectory;
                            if (PluginInfo == null && IntermediateDirectory != Target.EngineIntermediateDirectory && Path.GetFullPath(DependencyModule.ModuleDirectory).StartsWith(Path.GetFullPath(BuildConfiguration.RelativeEnginePath)))
                            {
                                IntermediateDirectory = Target.EngineIntermediateDirectory;
                            }

                            // When using modular linkage, unbound modules will be linked into their own DLL files
                            UEBuildBinaryConfiguration Config = new UEBuildBinaryConfiguration( InType: UEBuildBinaryType.DynamicLinkLibrary,
                                                                                                InOutputFilePath: OutputFilePath,
                                                                                                InIntermediateDirectory: IntermediateDirectory,
                                                                                                bInAllowExports: true,
                                                                                                InModuleNames: new List<string> { DependencyModule.Name },
                                                                                                InTargetName: Target.GetAppName(),
                                                                                                bInIsCrossTarget: PlatformSpecificDynamicallyLoadedModuleNames.Contains(DependencyName) && !DynamicallyLoadedModuleNames.Contains(DependencyName),
                                                                                                InTargetConfiguration: Target.Configuration,
                                                                                                bInCompileMonolithic: Target.ShouldCompileMonolithic() );

                            // Fix up the binary path if this is module specifies an alternate output directory
                            Config.OutputFilePath = DependencyModule.FixupOutputPath(Config.OutputFilePath);

                            BinaryToBindTo = new UEBuildBinaryCPP( Target, Config );
                        }

                        Binaries[ DependencyModule.Name ] = BinaryToBindTo;

                        // Bind this module
                        DependencyModule.Binary = BinaryToBindTo;
                        DependencyModule.bIncludedInTarget = true;

                        // Also add binaries for this module's dependencies
                        DependencyModule.RecursivelyProcessUnboundModules( Target, ref Binaries, ExecutableBinary );
                    }
                }

                if (Target.ShouldCompileMonolithic() == false)
                {
                    // Check to see if there is a circular relationship between the module and it's referencer
                    if( DependencyModule.Binary != null )
                    {
                        if( CircularlyReferencedDependentModules.Contains( DependencyName ) )
                        {
                            DependencyModule.Binary.SetCreateImportLibrarySeparately( true );
                        }
                    }
                }
            }

            // Also make sure module entries are created for any module that is pulled in as an "include path" module.
            // These modules are never linked in unless they were referenced as an actual dependency of a different module,
            // but we still need to keep track of them so that we can find their include paths when setting up our
            // module's include paths.
            RecursivelyAddIncludePathModules( Target, bPublicIncludesOnly:false );
        }
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:93,代码来源:UEBuildModule.cs


注:本文中的UnrealBuildTool.UEBuildTarget.FindOrCreateModuleByName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。