本文整理汇总了C#中CPPTargetConfiguration类的典型用法代码示例。如果您正苦于以下问题:C# CPPTargetConfiguration类的具体用法?C# CPPTargetConfiguration怎么用?C# CPPTargetConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CPPTargetConfiguration类属于命名空间,在下文中一共展示了CPPTargetConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSharedArguments_Global
static string GetSharedArguments_Global(CPPTargetConfiguration TargetConfiguration, string Architecture, bool bEnableShadowVariableWarning)
{
string Result = " ";
if (Architecture == "-win32")
{
return Result;
}
// Result += " -funsigned-char";
// Result += " -fno-strict-aliasing";
Result += " -fno-exceptions";
// Result += " -fno-short-enums";
Result += " -Wno-unused-value"; // appErrorf triggers this
Result += " -Wno-switch"; // many unhandled cases
Result += " -Wno-tautological-constant-out-of-range-compare"; // disables some warnings about comparisons from TCHAR being a char
// this hides the "warning : comparison of unsigned expression < 0 is always false" type warnings due to constant comparisons, which are possible with template arguments
Result += " -Wno-tautological-compare";
// okay, in UE4, we'd fix the code for these, but in UE3, not worth it
Result += " -Wno-logical-op-parentheses"; // appErrorf triggers this
Result += " -Wno-array-bounds"; // some VectorLoads go past the end of the array, but it's okay in that case
Result += " -Wno-invalid-offsetof"; // too many warnings kills windows clang.
if (bEnableShadowVariableWarning)
{
Result += " -Wshadow" + (BuildConfiguration.bShadowVariableErrors? "" : " -Wno-error=shadow");
}
// JavsScript option overrides (see src/settings.js)
// we have to specify the full amount of memory with Asm.JS (1.5 G)
// I wonder if there's a per game way to change this.
int TotalMemory = 256 * 1024 * 1024;
Result += " -s TOTAL_MEMORY=" + TotalMemory.ToString();
// no need for exceptions
Result += " -s DISABLE_EXCEPTION_CATCHING=1";
// enable checking for missing functions at link time as opposed to runtime
Result += " -s WARN_ON_UNDEFINED_SYMBOLS=1";
// we want full ES2
Result += " -s FULL_ES2=1 ";
// export console command handler. Export main func too because default exports ( e.g Main ) are overridden if we use custom exported functions.
Result += " -s EXPORTED_FUNCTIONS=\"['_main', '_resize_game', '_on_fatal']\" ";
// NOTE: This may slow down the compiler's startup time!
{
Result += " -s NO_EXIT_RUNTIME=1 --memory-init-file 1";
}
if (bEnableTracing)
{
Result += " --tracing";
}
return Result;
}
示例2: GetAdditionalLinkerFlags
public string GetAdditionalLinkerFlags(CPPTargetConfiguration InConfiguration)
{
if (InConfiguration != CPPTargetConfiguration.Shipping)
{
return AdditionalLinkerFlags;
}
else
{
return AdditionalShippingLinkerFlags;
}
}
示例3: ValidateBuildConfiguration
public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
{
if (BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac)
{
// @todo: Temporarily disable precompiled header files when building remotely due to errors
BuildConfiguration.bUsePCHFiles = false;
}
BuildConfiguration.bCheckExternalHeadersForModification = BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac;
BuildConfiguration.bCheckSystemHeadersForModification = BuildHostPlatform.Current.Platform != UnrealTargetPlatform.Mac;
BuildConfiguration.ProcessorCountMultiplier = MacToolChain.GetAdjustedProcessorCountMultiplier();
BuildConfiguration.bUseSharedPCHs = false;
BuildConfiguration.bUsePDBFiles = bCreateDebugInfo && Configuration != CPPTargetConfiguration.Debug && Platform == CPPTargetPlatform.Mac && BuildConfiguration.bGeneratedSYMFile;
// we always deploy - the build machines need to be able to copy the files back, which needs the full bundle
BuildConfiguration.bDeployAfterCompile = true;
}
示例4: ValidateBuildConfiguration
public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
{
// check the base first
base.ValidateBuildConfiguration(Configuration, Platform, bCreateDebugInfo);
BuildConfiguration.bUsePCHFiles = false;
BuildConfiguration.bUseSharedPCHs = false;
BuildConfiguration.bCheckExternalHeadersForModification = false;
BuildConfiguration.bCheckSystemHeadersForModification = false;
BuildConfiguration.ProcessorCountMultiplier = IOSToolChain.GetAdjustedProcessorCountMultiplier();
BuildConfiguration.bDeployAfterCompile = true;
}
示例5: SetUpProjectEnvironment
public void SetUpProjectEnvironment(CPPTargetConfiguration Configuration)
{
UnrealTargetConfiguration unrealConfiguration;
switch (Configuration)
{
case CPPTargetConfiguration.Shipping:
unrealConfiguration = UnrealTargetConfiguration.Shipping;
break;
case CPPTargetConfiguration.Development:
unrealConfiguration = UnrealTargetConfiguration.Development;
break;
default:
unrealConfiguration = UnrealTargetConfiguration.DebugGame;
break;
}
SetUpProjectEnvironment(unrealConfiguration);
}
示例6: ValidateBuildConfiguration
/**
* Validate configuration for this platform
* NOTE: This function can/will modify BuildConfiguration!
*
* @param InPlatform The CPPTargetPlatform being built
* @param InConfiguration The CPPTargetConfiguration being built
* @param bInCreateDebugInfo true if debug info is getting create, false if not
*/
public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
{
// increase Unity size to avoid too long command lines
BuildConfiguration.NumIncludedBytesPerUnityCPP = 1024 * 1024;
}
示例7: ValidateBuildConfiguration
/**
* Validate configuration for this platform
* NOTE: This function can/will modify BuildConfiguration!
*
* @param InPlatform The CPPTargetPlatform being built
* @param InConfiguration The CPPTargetConfiguration being built
* @param bInCreateDebugInfo true if debug info is getting create, false if not
*/
public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
{
UEBuildConfiguration.bCompileSimplygon = false;
}
示例8: GetVCToolPath
/** Accesses the bin directory for the VC toolchain for the specified platform. */
static string GetVCToolPath(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, string ToolName)
{
// Initialize environment variables required for spawned tools.
InitializeEnvironmentVariables(Platform);
// Out variable that is going to contain fully qualified path to executable upon return.
string VCToolPath = "";
// is target 64-bit?
bool bIsTarget64Bit = true;
// We need to differentiate between 32 and 64 bit toolchain on Windows.
{
// rc.exe resides in the Windows SDK folder.
if (ToolName.ToUpperInvariant() == "RC")
{
// 64 bit -- we can use the 32 bit version to target 64 bit on 32 bit OS.
if (bIsTarget64Bit)
{
VCToolPath = Path.Combine(WindowsSDKDir, "bin/x64/rc.exe");
}
// 32 bit
else
{
VCToolPath = Path.Combine(WindowsSDKDir, "bin/x86/rc.exe");
}
}
// cl.exe and link.exe are found in the toolchain specific folders (32 vs. 64 bit). We do however use the 64 bit linker if available
// even when targeting 32 bit as it's noticeably faster.
else
{
// Grab path to Visual Studio binaries from the system environment
string BaseVSToolPath = WindowsPlatform.GetVSComnToolsPath(WindowsCompiler.VisualStudio2012);
if (string.IsNullOrEmpty(BaseVSToolPath))
{
throw new BuildException("Visual Studio 2012 must be installed in order to build this target.");
}
if (Platform == CPPTargetPlatform.WinRT_ARM)
{
VCToolPath = Path.Combine(BaseVSToolPath, "../../VC/bin/x86_arm/" + ToolName + ".exe");
}
else
{
VCToolPath = Path.Combine(BaseVSToolPath, "../../VC/bin/amd64/" + ToolName + ".exe");
}
}
}
return VCToolPath;
}
示例9: ShouldUsePCHFiles
/**
* Whether PCH files should be used
*
* @param InPlatform The CPPTargetPlatform being built
* @param InConfiguration The CPPTargetConfiguration being built
*
* @return bool true if PCH files should be used, false if not
*/
public virtual bool ShouldUsePCHFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration)
{
return BuildConfiguration.bUsePCHFiles;
}
示例10: ShouldUseIncrementalLinking
/**
* Whether incremental linking should be used
*
* @param InPlatform The CPPTargetPlatform being built
* @param InConfiguration The CPPTargetConfiguration being built
*
* @return bool true if incremental linking should be used, false if not
*/
public virtual bool ShouldUseIncrementalLinking(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration)
{
return false;
}
示例11: GetSharedArguments_Global
static string GetSharedArguments_Global(CPPTargetConfiguration TargetConfiguration, string Architecture)
{
string Result = " ";
if (Architecture == "-win32")
{
return Result;
}
// Result += " -funsigned-char";
// Result += " -fno-strict-aliasing";
Result += " -fno-exceptions";
// Result += " -fno-short-enums";
Result += " -Wno-unused-value"; // appErrorf triggers this
Result += " -Wno-switch"; // many unhandled cases
Result += " -Wno-tautological-constant-out-of-range-compare"; // disables some warnings about comparisons from TCHAR being a char
// this hides the "warning : comparison of unsigned expression < 0 is always false" type warnings due to constant comparisons, which are possible with template arguments
Result += " -Wno-tautological-compare";
// okay, in UE4, we'd fix the code for these, but in UE3, not worth it
Result += " -Wno-logical-op-parentheses"; // appErrorf triggers this
Result += " -Wno-array-bounds"; // some VectorLoads go past the end of the array, but it's okay in that case
Result += " -Wno-invalid-offsetof"; // too many warnings kills windows clang.
// JavsScript option overrides (see src/settings.js)
// we have to specify the full amount of memory with Asm.JS (1.5 G)
// I wonder if there's a per game way to change this.
Result += " -s TOTAL_MEMORY=1610612736";
// no need for exceptions
Result += " -s DISABLE_EXCEPTION_CATCHING=1";
// enable checking for missing functions at link time as opposed to runtime
Result += " -s WARN_ON_UNDEFINED_SYMBOLS=1";
// we want full ES2
Result += " -s FULL_ES2=1 ";
// don't need UTF8 string support, and it slows string ops down
Result += " -s UTF_STRING_SUPPORT=0";
Result += " ";
if (TargetConfiguration == CPPTargetConfiguration.Debug)
{
Result += " -O0";
}
if (TargetConfiguration == CPPTargetConfiguration.Debug || TargetConfiguration == CPPTargetConfiguration.Development)
{
Result += " -s GL_ASSERTIONS=1 ";
}
if (TargetConfiguration == CPPTargetConfiguration.Development)
{
Result += " -O2 -s ASM_JS=1 -s OUTLINING_LIMIT=110000";
}
if (TargetConfiguration == CPPTargetConfiguration.Shipping)
{
Result += " -O2 -s ASM_JS=1 -s OUTLINING_LIMIT=110000";
}
// NOTE: This may slow down the compiler's startup time!
if ( !bEnableFastIteration )
{
Result += " --memory-init-file 1";
}
return Result;
}
示例12: GetArchitectureArgument
static string GetArchitectureArgument(CPPTargetConfiguration Configuration, string UBTArchitecture)
{
// get the list of architectures to compile
string Archs =
UBTArchitecture == "-simulator" ? "i386" :
(Configuration == CPPTargetConfiguration.Shipping) ? ShippingArchitectures : NonShippingArchitectures;
if (!bHasPrinted)
{
bHasPrinted = true;
Console.WriteLine("Compiling with these architectures: " + Archs);
}
// parse the string
string[] Tokens = Archs.Split(",".ToCharArray());
string Result = "";
foreach (string Token in Tokens)
{
Result += " -arch " + Token;
}
return Result;
}
示例13: ValidateBuildConfiguration
public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
{
// @todo clang: PCH files aren't supported by "clang-cl" yet (no /Yc support, and "-x c++-header" cannot be specified)
// @todo clang: PCH files with regular Clang on Windows have bugs with pack alignment and segfaults occasionally
if( WindowsPlatform.bCompileWithClang )
{
BuildConfiguration.bUsePCHFiles = false;
BuildConfiguration.bUseSharedPCHs = false;
}
}
示例14: ValidateBuildConfiguration
public override void ValidateBuildConfiguration(CPPTargetConfiguration Configuration, CPPTargetPlatform Platform, bool bCreateDebugInfo)
{
// @todo clang: PCH files aren't quite working yet with "clang-cl" (no /Yc support, and "-x c++-header" cannot be specified)
if (WindowsPlatform.bCompileWithClang)
{
BuildConfiguration.bUsePCHFiles = false;
BuildConfiguration.bUseSharedPCHs = false;
}
}
示例15: GetVCToolPath
/** Accesses the bin directory for the VC toolchain for the specified platform. */
static string GetVCToolPath(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, string ToolName)
{
// Initialize environment variables required for spawned tools.
InitializeEnvironmentVariables( Platform );
// Out variable that is going to contain fully qualified path to executable upon return.
string VCToolPath = "";
// rc.exe resides in the Windows SDK folder.
if (ToolName.ToUpperInvariant() == "RC")
{
// 64 bit -- we can use the 32 bit version to target 64 bit on 32 bit OS.
if (Platform == CPPTargetPlatform.Win64)
{
VCToolPath = Path.Combine(WindowsSDKDir, "bin/x64/rc.exe");
}
// 32 bit
else
{
if( !WindowsPlatform.SupportWindowsXP ) // Windows XP requires use to force Windows SDK 7.1 even on the newer compiler, so we need the old path RC.exe
{
VCToolPath = Path.Combine( WindowsSDKDir, "bin/x86/rc.exe" );
}
else
{
VCToolPath = Path.Combine( WindowsSDKDir, "bin/rc.exe" );
}
}
}
// cl.exe and link.exe are found in the toolchain specific folders (32 vs. 64 bit)
else
{
bool bIsRequestingLinkTool = ToolName.Equals( "link", StringComparison.InvariantCultureIgnoreCase );
bool bIsRequestingLibTool = ToolName.Equals( "lib", StringComparison.InvariantCultureIgnoreCase );
// If we were asked to use Clang, then we'll redirect the path to the compiler to the LLVM installation directory
if( WindowsPlatform.bCompileWithClang && !bIsRequestingLinkTool && !bIsRequestingLibTool )
{
VCToolPath = Path.Combine( Environment.GetFolderPath( Environment.SpecialFolder.ProgramFilesX86 ), "LLVM", "msbuild-bin", ToolName + ".exe" );
if( !File.Exists( VCToolPath ) )
{
throw new BuildException( "Clang was selected as the Windows compiler, but LLVM/Clang does not appear to be installed. Could not find: " + VCToolPath );
}
}
else
{
string BaseVSToolPath = FindBaseVSToolPath();
// Both target and build machines are 64 bit
bool bIs64Bit = (Platform == CPPTargetPlatform.Win64);
// Regardless of the target, if we're linking on a 64 bit machine, we want to use the 64 bit linker (it's faster than the 32 bit linker)
//@todo.WIN32: Using the 64-bit linker appears to be broken at the moment.
bool bUse64BitLinker = (Platform == CPPTargetPlatform.Win64) && bIsRequestingLinkTool;
// Use the 64 bit tools if the build machine and target are 64 bit or if we're linking a 32 bit binary on a 64 bit machine
if (bIs64Bit || bUse64BitLinker)
{
// Use the native 64-bit compiler if present, otherwise use the amd64-on-x86 compiler. VS2012 Express only includes the latter.
string PlatformToolPath = Path.Combine(BaseVSToolPath, "../../VC/bin/amd64/");
if(!Directory.Exists(PlatformToolPath))
{
PlatformToolPath = Path.Combine(BaseVSToolPath, "../../VC/bin/x86_amd64/");
}
VCToolPath = PlatformToolPath + ToolName + ".exe";
}
else
{
// Use 32 bit for cl.exe and other tools, or for link.exe if 64 bit path doesn't exist and we're targeting 32 bit.
VCToolPath = Path.Combine(BaseVSToolPath, "../../VC/bin/" + ToolName + ".exe");
}
}
}
return VCToolPath;
}