本文整理汇总了C#中UnrealBuildTool.UEBuildTarget.ShouldCompileMonolithic方法的典型用法代码示例。如果您正苦于以下问题:C# UEBuildTarget.ShouldCompileMonolithic方法的具体用法?C# UEBuildTarget.ShouldCompileMonolithic怎么用?C# UEBuildTarget.ShouldCompileMonolithic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnrealBuildTool.UEBuildTarget
的用法示例。
在下文中一共展示了UEBuildTarget.ShouldCompileMonolithic方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GeneratePathForTarget
/// <summary>
/// Generates a full path to action history file for the specified target.
/// </summary>
public static string GeneratePathForTarget(UEBuildTarget Target)
{
string Folder = null;
if (Target.ShouldCompileMonolithic() || Target.Rules.Type == TargetRules.TargetType.Program)
{
// Monolithic configs and programs have their Action History stored in their respective project folders
// or under engine intermediate folder + program name folder
string RootDirectory = UnrealBuildTool.GetUProjectPath();
if (String.IsNullOrEmpty(RootDirectory))
{
RootDirectory = Path.GetFullPath(BuildConfiguration.RelativeEnginePath);
}
Folder = Path.Combine(RootDirectory, BuildConfiguration.PlatformIntermediateFolder, Target.GetTargetName());
}
else
{
// Shared action history (unless this is a rocket target)
Folder = UnrealBuildTool.RunningRocket() ?
Path.Combine(UnrealBuildTool.GetUProjectPath(), BuildConfiguration.BaseIntermediateFolder) :
BuildConfiguration.BaseIntermediatePath;
}
return Path.Combine(Folder, "ActionHistory.bin").Replace("\\", "/");
}
示例2: SetUpEnvironment
/**
* Setup the target environment for building
*
* @param InBuildTarget The target being built
*/
public override void SetUpEnvironment(UEBuildTarget InBuildTarget)
{
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("WIN32=1");
// Should we enable Windows XP support
if ((InBuildTarget.TargetType == TargetRules.TargetType.Program) && (GetCPPTargetPlatform(InBuildTarget.Platform) == CPPTargetPlatform.Win32))
{
// Check if the target has requested XP support.
if (String.Equals(InBuildTarget.Rules.PreferredSubPlatform, "WindowsXP", StringComparison.InvariantCultureIgnoreCase))
{
SupportWindowsXP = true;
}
}
if (WindowsPlatform.bUseWindowsSDK10 && WindowsPlatform.Compiler == WindowsCompiler.VisualStudio2015)
{
if (SupportWindowsXP)
{
throw new NotSupportedException("Windows XP support is not possible when targeting the Windows 10 SDK");
}
// Windows 8 or higher required
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("_WIN32_WINNT=0x0602");
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("WINVER=0x0602");
}
else
{
if (SupportWindowsXP)
{
// Windows XP SP3 or higher required
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("_WIN32_WINNT=0x0502");
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("WINVER=0x0502");
}
else
{
// Windows Vista or higher required
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("_WIN32_WINNT=0x0600");
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("WINVER=0x0600");
}
}
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("PLATFORM_WINDOWS=1");
String MorpheusShaderPath = Path.Combine(BuildConfiguration.RelativeEnginePath, "Shaders/PS4/PostProcessHMDMorpheus.usf");
//@todo: VS2015 currently does not have support for Morpheus
if (File.Exists(MorpheusShaderPath) && WindowsPlatform.Compiler != WindowsCompiler.VisualStudio2015)
{
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("HAS_MORPHEUS=1");
//on PS4 the SDK now handles distortion correction. On PC we will still have to handle it manually,
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("MORPHEUS_ENGINE_DISTORTION=1");
}
if (InBuildTarget.Rules != null)
{
// Explicitly exclude the MS C++ runtime libraries we're not using, to ensure other libraries we link with use the same
// runtime library as the engine.
bool bUseDebugCRT = InBuildTarget.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT;
if(!InBuildTarget.Rules.bUseStaticCRT || bUseDebugCRT)
{
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCMT");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCPMT");
}
if(!InBuildTarget.Rules.bUseStaticCRT || !bUseDebugCRT)
{
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCMTD");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCPMTD");
}
if (InBuildTarget.Rules.bUseStaticCRT || bUseDebugCRT)
{
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("MSVCRT");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("MSVCPRT");
}
if(InBuildTarget.Rules.bUseStaticCRT || !bUseDebugCRT)
{
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("MSVCRTD");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("MSVCPRTD");
}
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBC");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCP");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCD");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCPD");
//@todo ATL: Currently, only VSAccessor requires ATL (which is only used in editor builds)
// When compiling games, we do not want to include ATL - and we can't when compiling Rocket games
// due to VS 2012 Express not including ATL.
// If more modules end up requiring ATL, this should be refactored into a BuildTarget flag (bNeedsATL)
// that is set by the modules the target includes to allow for easier tracking.
// Alternatively, if VSAccessor is modified to not require ATL than we should always exclude the libraries.
if (InBuildTarget.ShouldCompileMonolithic() && (InBuildTarget.Rules != null) &&
(TargetRules.IsGameType(InBuildTarget.TargetType)) && (TargetRules.IsEditorType(InBuildTarget.TargetType) == false))
{
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("atl");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("atls");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("atlsd");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("atlsn");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("atlsnd");
//.........这里部分代码省略.........
示例3: SetUpEnvironment
/**
* Setup the target environment for building
*
* @param InBuildTarget The target being built
*/
public override void SetUpEnvironment(UEBuildTarget InBuildTarget)
{
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("WIN32=1");
if( SupportWindowsXP )
{
// Windows XP SP3 or higher required
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("_WIN32_WINNT=0x0502");
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("WINVER=0x0502");
}
else
{
// Windows Vista or higher required
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("_WIN32_WINNT=0x0600");
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("WINVER=0x0600");
}
InBuildTarget.GlobalCompileEnvironment.Config.Definitions.Add("PLATFORM_WINDOWS=1");
if (InBuildTarget.Rules != null)
{
// Explicitly exclude the MS C++ runtime libraries we're not using, to ensure other libraries we link with use the same
// runtime library as the engine.
if (InBuildTarget.Configuration == UnrealTargetConfiguration.Debug && BuildConfiguration.bDebugBuildsActuallyUseDebugCRT)
{
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("MSVCRT");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("MSVCPRT");
}
else
{
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("MSVCRTD");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("MSVCPRTD");
}
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBC");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCMT");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCPMT");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCP");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCD");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCMTD");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCPMTD");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("LIBCPD");
//@todo ATL: Currently, only VSAccessor requires ATL (which is only used in editor builds)
// When compiling games, we do not want to include ATL - and we can't when compiling Rocket games
// due to VS 2012 Express not including ATL.
// If more modules end up requiring ATL, this should be refactored into a BuildTarget flag (bNeedsATL)
// that is set by the modules the target includes to allow for easier tracking.
// Alternatively, if VSAccessor is modified to not require ATL than we should always exclude the libraries.
if (InBuildTarget.ShouldCompileMonolithic() && (InBuildTarget.Rules != null) &&
(TargetRules.IsGameType(InBuildTarget.Rules.Type)) && (TargetRules.IsEditorType(InBuildTarget.Rules.Type) == false))
{
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("atl");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("atls");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("atlsd");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("atlsn");
InBuildTarget.GlobalLinkEnvironment.Config.ExcludedLibraries.Add("atlsnd");
}
// Add the library used for the delayed loading of DLLs.
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("delayimp.lib");
//@todo - remove once FB implementation uses Http module
if (UEBuildConfiguration.bCompileAgainstEngine)
{
// link against wininet (used by FBX and Facebook)
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("wininet.lib");
}
// Compile and link with Win32 API libraries.
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("rpcrt4.lib");
//InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("wsock32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("ws2_32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("dbghelp.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("comctl32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("Winmm.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("kernel32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("user32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("gdi32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("winspool.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("comdlg32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("advapi32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("shell32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("ole32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("oleaut32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("uuid.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("odbc32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("odbccp32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("netapi32.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("iphlpapi.lib");
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("setupapi.lib"); // Required for access monitor device enumeration
// Windows Vista/7 Desktop Windows Manager API for Slate Windows Compliance
if( !SupportWindowsXP ) // Windows XP does not support DWM
{
InBuildTarget.GlobalLinkEnvironment.Config.AdditionalLibraries.Add("dwmapi.lib");
}
//.........这里部分代码省略.........
示例4: GetGeneratedCodeDirectoryForModule
/// <summary>
/// Determines where generated code files will be stored for this module
/// </summary>
/// <param name="ModuleDirectory">Module's base directory</param>
/// <param name="ModuleName">Name of module</param>
/// <returns></returns>
public static string GetGeneratedCodeDirectoryForModule(UEBuildTarget Target, string ModuleDirectory, string ModuleName)
{
string BaseDirectory = null;
if ((Target.ShouldCompileMonolithic() || Target.Rules.Type == TargetRules.TargetType.Program) &&
(!UnrealBuildTool.BuildingRocket()) &&
(!UnrealBuildTool.RunningRocket() || Utils.IsFileUnderDirectory(ModuleDirectory, UnrealBuildTool.GetUProjectPath())))
{
// Monolithic configurations and programs have their intermediate headers stored under their
// respective project folders with the exception of rocket which always stores engine modules in the engine folder.
string RootDirectory = UnrealBuildTool.GetUProjectPath();
if (String.IsNullOrEmpty(RootDirectory))
{
// Intermediates under Engine intermediate folder (program name will be appended later)
RootDirectory = Path.GetFullPath(BuildConfiguration.RelativeEnginePath);
}
BaseDirectory = Path.Combine(RootDirectory, BuildConfiguration.PlatformIntermediateFolder, Target.GetTargetName());
}
else if (Plugins.IsPluginModule(ModuleName))
{
// Plugin module
BaseDirectory = Path.Combine(Plugins.GetPluginInfoForModule(ModuleName).Directory, BuildConfiguration.PlatformIntermediateFolder);
}
else
{
var AllProjectFolders = UEBuildTarget.DiscoverAllGameFolders();
BaseDirectory = AllProjectFolders.Find(ProjectFolder => Utils.IsFileUnderDirectory( ModuleDirectory, ProjectFolder ));
if (BaseDirectory == null)
{
// Must be an engine module or program module
BaseDirectory = ProjectFileGenerator.EngineRelativePath;
}
BaseDirectory = Path.GetFullPath(Path.Combine(BaseDirectory, BuildConfiguration.PlatformIntermediateFolder));
}
// Construct the intermediate path.
var GeneratedCodeDirectory = Path.Combine(BaseDirectory, "Inc", ModuleName);
return GeneratedCodeDirectory + Path.DirectorySeparatorChar;
}
示例5: 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 );
}
示例6: GeneratePathForTarget
/// <summary>
/// Generates a full path to action history file for the specified target.
/// </summary>
public static FileReference GeneratePathForTarget(UEBuildTarget Target)
{
DirectoryReference Folder = null;
if (Target.ShouldCompileMonolithic() || Target.TargetType == TargetRules.TargetType.Program)
{
// Monolithic configs and programs have their Action History stored in their respective project folders
// or under engine intermediate folder + program name folder
DirectoryReference RootDirectory;
if (Target.ProjectFile != null)
{
RootDirectory = Target.ProjectFile.Directory;
}
else
{
RootDirectory = UnrealBuildTool.EngineDirectory;
}
Folder = DirectoryReference.Combine(RootDirectory, BuildConfiguration.PlatformIntermediateFolder, Target.GetTargetName());
}
else
{
// Shared action history (unless this is an installed build target)
Folder = (UnrealBuildTool.IsEngineInstalled() && Target.ProjectFile != null) ?
DirectoryReference.Combine(Target.ProjectFile.Directory, BuildConfiguration.BaseIntermediateFolder) :
DirectoryReference.Combine(UnrealBuildTool.EngineDirectory, BuildConfiguration.BaseIntermediateFolder);
}
return FileReference.Combine(Folder, "ActionHistory.bin");
}