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


C# CPPEnvironment.FindIncludedFile方法代码示例

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


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

示例1: Compile


//.........这里部分代码省略.........
                        // Find headers used by the source file.
                        List<DependencyInclude> DirectIncludeFilenames = CPPEnvironment.GetDirectIncludeDependencies( CPPFile, ModuleCompileEnvironment.Config.TargetPlatform, ModuleCompileEnvironment.bHackHeaderGenerator );
                        if( BuildConfiguration.bPrintDebugInfo )
                        {
                            var IncludedFileNames = new StringBuilder();
                            foreach( var CurInclude in DirectIncludeFilenames )
                            {
                                if( IncludedFileNames.Length > 0 )
                                {
                                    IncludedFileNames.Append( ", " );
                                }
                                IncludedFileNames.Append( Path.GetFileName( CurInclude.IncludeName ) );
                            }

                            Log.TraceVerbose( "Found direct includes for {0}: {1}", Path.GetFileName( CPPFile.AbsolutePath ), IncludedFileNames );
                        }

                        if( DirectIncludeFilenames.Count > 0 )
                        {
                            // The pch header should always be the first include in the source file.
                            // NOTE: This is not an absolute path.  This is just the literal include string from the source file!
                            CPPFile.PCHHeaderNameInCode = DirectIncludeFilenames[ 0 ].IncludeName;

                            // Resolve the PCH header to an absolute path.
                            // Check NullOrEmpty here because if the file could not be resolved we need to throw an exception
                            if (string.IsNullOrEmpty(DirectIncludeFilenames[0].IncludeResolvedName) ||
                                // ignore any preexisting resolve cache if we are not configured to use it.
                                !BuildConfiguration.bUseIncludeDependencyResolveCache ||
                                // if we are testing the resolve cache, we force UBT to resolve every time to look for conflicts
                                BuildConfiguration.bTestIncludeDependencyResolveCache)
                            {
                                string SourceFilesDirectory = Path.GetDirectoryName(CPPFile.AbsolutePath);
                                // search the include paths to resolve the file.
                                FileItem PrecompiledHeaderIncludeFile = ModuleCompileEnvironment.FindIncludedFile(CPPFile.PCHHeaderNameInCode, !BuildConfiguration.bCheckExternalHeadersForModification, SourceFilesDirectory);
                                if (PrecompiledHeaderIncludeFile != null)
                                {
                                    CPPEnvironment.IncludeDependencyCache.CacheResolvedIncludeFullPath(CPPFile, 0, PrecompiledHeaderIncludeFile.AbsolutePath);
                                    CPPFile.PrecompiledHeaderIncludeFilename = PrecompiledHeaderIncludeFile.AbsolutePath;

                                    if (UniquePCHHeaderFile == null)
                                    {
                                        UniquePCHHeaderFile = PrecompiledHeaderIncludeFile;
                                    }
                                }
                                else
                                {
                                    throw new BuildException("The first include statement in source file '{0}' is trying to include the file '{1}' as the precompiled header for module '{2}', but that file could not be located in any of the module's include search paths.", CPPFile.AbsolutePath, CPPFile.PCHHeaderNameInCode, this.Name);
                                }
                            }
                            else
                            {
                                CPPFile.PrecompiledHeaderIncludeFilename = DirectIncludeFilenames[0].IncludeResolvedName;
                                if (UniquePCHHeaderFile == null)
                                {
                                    UniquePCHHeaderFile = FileItem.GetItemByFullPath(CPPFile.PrecompiledHeaderIncludeFilename);
                                }
                            }
                        }
                    }

                    if( CPPFile.PrecompiledHeaderIncludeFilename == null )
                    {
                        throw new BuildException( "No PCH usage for file \"{0}\" . Missing #include header?", CPPFile.AbsolutePath );
                    }

                    // Create a new entry if not in the pch usage map
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:67,代码来源:UEBuildModule.cs


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