本文整理汇总了C#中CPPTargetPlatform类的典型用法代码示例。如果您正苦于以下问题:C# CPPTargetPlatform类的具体用法?C# CPPTargetPlatform怎么用?C# CPPTargetPlatform使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CPPTargetPlatform类属于命名空间,在下文中一共展示了CPPTargetPlatform类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: VCEnvironment
private VCEnvironment(CPPTargetPlatform InPlatform)
{
Platform = InPlatform;
// If Visual Studio is not installed, the Windows SDK path will be used, which also happens to be the same
// directory. (It installs the toolchain into the folder where Visual Studio would have installed it to).
BaseVSToolPath = WindowsPlatform.GetVSComnToolsPath();
if (string.IsNullOrEmpty(BaseVSToolPath))
{
throw new BuildException("Visual Studio 2012 or Visual Studio 2013 must be installed in order to build this target.");
}
WindowsSDKDir = FindWindowsSDKInstallationFolder(Platform);
PlatformVSToolPath = GetPlatformVSToolPath(Platform, BaseVSToolPath);
CompilerPath = GetCompilerToolPath(PlatformVSToolPath);
CLExeVersion = FindCLExeVersion(CompilerPath);
LinkerPath = GetLinkerToolPath(PlatformVSToolPath);
LibraryLinkerPath = GetLibraryLinkerToolPath(PlatformVSToolPath);
ResourceCompilerPath = GetResourceCompilerToolPath(Platform, WindowsSDKDir);
var VCVarsBatchFile = Path.Combine(BaseVSToolPath, (Platform == CPPTargetPlatform.Win64) ? "../../VC/bin/x86_amd64/vcvarsx86_amd64.bat" : "vsvars32.bat");
Utils.SetEnvironmentVariablesFromBatchFile(VCVarsBatchFile);
// When targeting Windows XP on Visual Studio 2012+, we need to override the Windows SDK include and lib path set
// by the batch file environment (http://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx)
if (WindowsPlatform.IsWindowsXPSupported())
{
// Lib and bin folders have a x64 subfolder for 64 bit development.
var ConfigSuffix = (Platform == CPPTargetPlatform.Win64) ? "\\x64" : "";
Environment.SetEnvironmentVariable("PATH", Utils.ResolveEnvironmentVariable(WindowsSDKDir + "bin" + ConfigSuffix + ";%PATH%"));
Environment.SetEnvironmentVariable("LIB", Utils.ResolveEnvironmentVariable(WindowsSDKDir + "lib" + ConfigSuffix + ";%LIB%"));
Environment.SetEnvironmentVariable("INCLUDE", Utils.ResolveEnvironmentVariable(WindowsSDKDir + "include;%INCLUDE%"));
}
}
开发者ID:rajeshwarn,项目名称:STEngine,代码行数:35,代码来源:VCEnvironment.cs
示例2: VCEnvironment
private VCEnvironment(CPPTargetPlatform InPlatform, bool bSupportWindowsXP)
{
Platform = InPlatform;
// Get the Visual Studio install directory
WindowsPlatform.TryGetVSInstallDir(WindowsPlatform.Compiler, out VSInstallDir);
// Get the Visual C++ compiler install directory.
if(!WindowsPlatform.TryGetVCInstallDir(WindowsPlatform.Compiler, out VCInstallDir))
{
throw new BuildException(WindowsPlatform.GetCompilerName(WindowsPlatform.Compiler) + " must be installed in order to build this target.");
}
WindowsSDKDir = FindWindowsSDKInstallationFolder(Platform, bSupportWindowsXP);
WindowsSDKLibVersion = FindWindowsSDKLibVersion(WindowsSDKDir);
WindowsSDKExtensionDir = FindWindowsSDKExtensionInstallationFolder();
NetFxSDKExtensionDir = FindNetFxSDKExtensionInstallationFolder();
WindowsSDKExtensionHeaderLibVersion = FindWindowsSDKExtensionLatestVersion(WindowsSDKExtensionDir);
UniversalCRTDir = bSupportWindowsXP ? "" : FindUniversalCRTInstallationFolder();
UniversalCRTVersion = bSupportWindowsXP ? "0.0.0.0" : FindUniversalCRTVersion(UniversalCRTDir);
VCToolPath32 = GetVCToolPath32(VCInstallDir);
VCToolPath64 = GetVCToolPath64(VCInstallDir);
// Compile using 64 bit tools for 64 bit targets, and 32 for 32.
DirectoryReference CompilerDir = (Platform == CPPTargetPlatform.Win64) ? VCToolPath64 : VCToolPath32;
// 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 and can handle large linking jobs)
DirectoryReference LinkerDir = VCToolPath64;
CompilerPath = GetCompilerToolPath(InPlatform, CompilerDir);
CLExeVersion = FindCLExeVersion(CompilerPath.FullName);
LinkerPath = GetLinkerToolPath(InPlatform, LinkerDir);
LibraryManagerPath = GetLibraryLinkerToolPath(InPlatform, LinkerDir);
ResourceCompilerPath = new FileReference(GetResourceCompilerToolPath(Platform, bSupportWindowsXP));
// Make sure the base 32-bit VS tool path is in the PATH, regardless of which configuration we're using. The toolchain may need to reference support DLLs from this directory (eg. mspdb120.dll).
string PathEnvironmentVariable = Environment.GetEnvironmentVariable("PATH") ?? "";
if (!PathEnvironmentVariable.Split(';').Any(x => String.Compare(x, VCToolPath32.FullName, true) == 0))
{
PathEnvironmentVariable = VCToolPath32.FullName + ";" + PathEnvironmentVariable;
Environment.SetEnvironmentVariable("PATH", PathEnvironmentVariable);
}
// Setup the INCLUDE environment variable
List<string> IncludePaths = GetVisualCppIncludePaths(VCInstallDir.FullName, UniversalCRTDir, UniversalCRTVersion, NetFxSDKExtensionDir, WindowsSDKDir, WindowsSDKLibVersion, bSupportWindowsXP);
if(InitialIncludePaths != null)
{
IncludePaths.Add(InitialIncludePaths);
}
Environment.SetEnvironmentVariable("INCLUDE", String.Join(";", IncludePaths));
// Setup the LIB environment variable
List<string> LibraryPaths = GetVisualCppLibraryPaths(VCInstallDir.FullName, UniversalCRTDir, UniversalCRTVersion, NetFxSDKExtensionDir, WindowsSDKDir, WindowsSDKLibVersion, Platform, bSupportWindowsXP);
if(InitialLibraryPaths != null)
{
LibraryPaths.Add(InitialLibraryPaths);
}
Environment.SetEnvironmentVariable("LIB", String.Join(";", LibraryPaths));
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:60,代码来源:VCEnvironment.cs
示例3: GetPlatformToolChain
public static IUEToolChain GetPlatformToolChain(CPPTargetPlatform InPlatform)
{
if (CPPToolChainDictionary.ContainsKey(InPlatform) == true)
{
return CPPToolChainDictionary[InPlatform];
}
throw new BuildException("GetPlatformToolChain: No tool chain found for {0}", InPlatform.ToString());
}
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:8,代码来源:UEToolChain.cs
示例4: RegisterRemoteToolChain
protected void RegisterRemoteToolChain(UnrealTargetPlatform InPlatform, CPPTargetPlatform CPPPlatform)
{
RemoteToolChainPlatform = InPlatform;
// Register this tool chain for IOS
Log.TraceVerbose(" Registered for {0}", CPPPlatform.ToString());
UEToolChain.RegisterPlatformToolChain(CPPPlatform, this);
}
开发者ID:didixp,项目名称:Ark-Dev-Kit,代码行数:8,代码来源:RemoteToolChain.cs
示例5: SetEnvironment
/// <summary>
/// Initializes environment variables required by toolchain. Different for 32 and 64 bit.
/// </summary>
public static VCEnvironment SetEnvironment(CPPTargetPlatform Platform, bool bSupportWindowsXP)
{
if (EnvVars != null && EnvVars.Platform == Platform)
{
return EnvVars;
}
EnvVars = new VCEnvironment(Platform, bSupportWindowsXP);
return EnvVars;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:13,代码来源:VCEnvironment.cs
示例6: SetEnvironment
/**
* Initializes environment variables required by toolchain. Different for 32 and 64 bit.
*/
public static VCEnvironment SetEnvironment(CPPTargetPlatform Platform)
{
if (EnvVars != null && EnvVars.Platform == Platform)
{
return EnvVars;
}
EnvVars = new VCEnvironment(Platform);
return EnvVars;
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:13,代码来源:VCEnvironment.cs
示例7: VCEnvironment
private VCEnvironment(CPPTargetPlatform InPlatform)
{
Platform = InPlatform;
// If Visual Studio is not installed, the Windows SDK path will be used, which also happens to be the same
// directory. (It installs the toolchain into the folder where Visual Studio would have installed it to).
BaseVSToolPath = WindowsPlatform.GetVSComnToolsPath();
if (string.IsNullOrEmpty(BaseVSToolPath))
{
throw new BuildException("Visual Studio 2012, 2013 or 2015 must be installed in order to build this target.");
}
WindowsSDKDir = FindWindowsSDKInstallationFolder(Platform);
WindowsSDKExtensionDir = FindWindowsSDKExtensionInstallationFolder();
NetFxSDKExtensionDir = FindNetFxSDKExtensionInstallationFolder();
WindowsSDKExtensionHeaderLibVersion = FindWindowsSDKExtensionLatestVersion(WindowsSDKExtensionDir);
PlatformVSToolPath = GetPlatformVSToolPath (Platform, BaseVSToolPath);
CompilerPath = GetCompilerToolPath (PlatformVSToolPath);
CLExeVersion = FindCLExeVersion (CompilerPath);
LinkerPath = GetLinkerToolPath (PlatformVSToolPath);
LibraryLinkerPath = GetLibraryLinkerToolPath (PlatformVSToolPath);
ResourceCompilerPath = GetResourceCompilerToolPath(Platform);
// We ensure an extra trailing slash because of a user getting an odd error where the paths seemed to get concatenated wrongly:
//
// C:\Programme\Microsoft Visual Studio 12.0\Common7\Tools../../VC/bin/x86_amd64/vcvarsx86_amd64.bat
//
// https://answers.unrealengine.com/questions/233640/unable-to-create-project-files-for-48-preview-3.html
//
bool bUse64BitCompiler = Platform == CPPTargetPlatform.Win64 || Platform == CPPTargetPlatform.UWP;
string BaseToolPathWithTrailingSlash = BaseVSToolPath.TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar;
string VCVarsBatchFile = Path.Combine(BaseToolPathWithTrailingSlash, bUse64BitCompiler ? @"..\..\VC\bin\x86_amd64\vcvarsx86_amd64.bat" : "vsvars32.bat");
if (Platform == CPPTargetPlatform.UWP && UWPPlatform.bBuildForStore)
{
Utils.SetEnvironmentVariablesFromBatchFile(VCVarsBatchFile, "store");
}
else
{
Utils.SetEnvironmentVariablesFromBatchFile(VCVarsBatchFile);
}
// When targeting Windows XP on Visual Studio 2012+, we need to override the Windows SDK include and lib path set
// by the batch file environment (http://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx)
if (WindowsPlatform.IsWindowsXPSupported())
{
// Lib and bin folders have a x64 subfolder for 64 bit development.
var ConfigSuffix = (Platform == CPPTargetPlatform.Win64) ? "\\x64" : "";
Environment.SetEnvironmentVariable("PATH", Utils.ResolveEnvironmentVariable(WindowsSDKDir + "bin" + ConfigSuffix + ";%PATH%"));
Environment.SetEnvironmentVariable("LIB", Utils.ResolveEnvironmentVariable(WindowsSDKDir + "lib" + ConfigSuffix + ";%LIB%"));
Environment.SetEnvironmentVariable("INCLUDE", Utils.ResolveEnvironmentVariable(WindowsSDKDir + "include;%INCLUDE%"));
}
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:53,代码来源:VCEnvironment.cs
示例8: RegisterPlatformToolChain
public static void RegisterPlatformToolChain(CPPTargetPlatform InPlatform, IUEToolChain InToolChain)
{
if (CPPToolChainDictionary.ContainsKey(InPlatform) == true)
{
Log.TraceInformation("RegisterPlatformToolChain Warning: Registering tool chain {0} for {1} when it is already set to {2}",
InToolChain.ToString(), InPlatform.ToString(), CPPToolChainDictionary[InPlatform].ToString());
CPPToolChainDictionary[InPlatform] = InToolChain;
}
else
{
CPPToolChainDictionary.Add(InPlatform, InToolChain);
}
}
开发者ID:xiangyuan,项目名称:Unreal4,代码行数:13,代码来源:UEToolChain.cs
示例9: GetBuildPlatformForCPPTargetPlatform
/**
* Retrieve the UEBuildPlatform instance for the given CPPTargetPlatform
*
* @param InPlatform The CPPTargetPlatform being built
* @param bInAllowFailure If true, do not throw an exception and return null
*
* @return UEBuildPlatform The instance of the build platform
*/
public static UEBuildPlatform GetBuildPlatformForCPPTargetPlatform(CPPTargetPlatform InPlatform, bool bInAllowFailure = false)
{
UnrealTargetPlatform UTPlatform = UEBuildTarget.CPPTargetPlatformToUnrealTargetPlatform(InPlatform);
if (BuildPlatformDictionary.ContainsKey(UTPlatform) == true)
{
return BuildPlatformDictionary[UTPlatform];
}
if (bInAllowFailure == true)
{
return null;
}
throw new BuildException("UEBuildPlatform::GetBuildPlatformForCPPTargetPlatform: No BuildPlatform found for {0}", InPlatform.ToString());
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:21,代码来源:UEBuildPlatform.cs
示例10: 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;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:17,代码来源:UEBuildMac.cs
示例11: GetVCIncludePaths
/** Gets the default include paths for the given platform. */
public static string GetVCIncludePaths(CPPTargetPlatform Platform)
{
Debug.Assert(Platform == CPPTargetPlatform.Win32 || Platform == CPPTargetPlatform.Win64);
// Make sure we've got the environment variables set up for this target
VCEnvironment.SetEnvironment(Platform);
// Also add any include paths from the INCLUDE environment variable. MSVC is not necessarily running with an environment that
// matches what UBT extracted from the vcvars*.bat using SetEnvironmentVariablesFromBatchFile(). We'll use the variables we
// extracted to populate the project file's list of include paths
// @todo projectfiles: Should we only do this for VC++ platforms?
var IncludePaths = Environment.GetEnvironmentVariable("INCLUDE");
if (!String.IsNullOrEmpty(IncludePaths) && !IncludePaths.EndsWith(";"))
{
IncludePaths += ";";
}
return IncludePaths;
}
开发者ID:rajeshwarn,项目名称:STEngine,代码行数:20,代码来源:VCToolChain.cs
示例12: CreateToolChain
public override UEToolChain CreateToolChain(CPPTargetPlatform Platform)
{
return new AndroidToolChain(ProjectFile);
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:4,代码来源:UEBuildAndroid.cs
示例13: GetResourceCompilerToolPath
/** Gets the path to the resource compiler's rc.exe for the specified platform. */
string GetResourceCompilerToolPath(CPPTargetPlatform Platform)
{
// 64 bit -- we can use the 32 bit version to target 64 bit on 32 bit OS.
if (Platform == CPPTargetPlatform.Win64 || Platform == CPPTargetPlatform.UWP)
{
if (WindowsPlatform.Compiler == WindowsCompiler.VisualStudio2015 && WindowsPlatform.bUseWindowsSDK10)
{
return Path.Combine(WindowsSDKExtensionDir, "bin/x64/rc.exe");
}
else
{
return Path.Combine(WindowsSDKDir, "bin/x64/rc.exe");
}
}
// @todo UWP: Verify that Windows XP will compile using VS 2015 (it should be supported)
if (!WindowsPlatform.IsWindowsXPSupported()) // Windows XP requires use to force Windows SDK 7.1 even on the newer compiler, so we need the old path RC.exe
{
if (WindowsPlatform.Compiler == WindowsCompiler.VisualStudio2015 && WindowsPlatform.bUseWindowsSDK10)
{
return Path.Combine(WindowsSDKExtensionDir, "bin/x86/rc.exe");
}
else
{
return Path.Combine(WindowsSDKDir, "bin/x86/rc.exe");
}
}
return Path.Combine(WindowsSDKDir, "bin/rc.exe");
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:30,代码来源:VCEnvironment.cs
示例14: GetPlatformVSToolPath
/** Gets the path to the tool binaries for the specified platform. */
static string GetPlatformVSToolPath(CPPTargetPlatform Platform, string BaseVSToolPath)
{
// 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.
if (Platform == CPPTargetPlatform.Win64 || Platform == CPPTargetPlatform.UWP)
{
// Use the native 64-bit compiler if present, otherwise use the amd64-on-x86 compiler. VS2012 Express only includes the latter.
var Result = Path.Combine(BaseVSToolPath, "../../VC/bin/amd64");
if (Directory.Exists(Result))
{
return Result;
}
return Path.Combine(BaseVSToolPath, "../../VC/bin/x86_amd64");
}
return Path.Combine(BaseVSToolPath, "../../VC/bin");
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:19,代码来源:VCEnvironment.cs
示例15: FindWindowsSDKInstallationFolder
/// <returns>The path to Windows SDK directory for the specified version.</returns>
private static string FindWindowsSDKInstallationFolder(CPPTargetPlatform InPlatform)
{
// When targeting Windows XP on Visual Studio 2012+, we need to point at the older Windows SDK 7.1A that comes
// installed with Visual Studio 2012 Update 1. (http://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx)
string Version;
if (WindowsPlatform.IsWindowsXPSupported())
{
Version = "v7.1A";
}
else switch (WindowsPlatform.Compiler)
{
case WindowsCompiler.VisualStudio2015:
if( WindowsPlatform.bUseWindowsSDK10 )
{
Version = "v10.0";
}
else
{
Version = "v8.1";
}
break;
case WindowsCompiler.VisualStudio2013:
Version = "v8.1";
break;
case WindowsCompiler.VisualStudio2012:
Version = "v8.0";
break;
default:
throw new BuildException("Unexpected compiler setting when trying to determine Windows SDK folder");
}
// Based on VCVarsQueryRegistry
string FinalResult = null;
foreach (string IndividualVersion in Version.Split('|'))
{
var Result = Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Microsoft SDKs\Windows\" + IndividualVersion, "InstallationFolder", null)
?? Microsoft.Win32.Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\" + IndividualVersion, "InstallationFolder", null)
?? Microsoft.Win32.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\" + IndividualVersion, "InstallationFolder", null);
if (Result != null)
{
FinalResult = (string)Result;
break;
}
}
if (FinalResult == null)
{
throw new BuildException("Windows SDK {0} must be installed in order to build this target.", Version);
}
return FinalResult;
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:56,代码来源:VCEnvironment.cs
示例16: CreateToolChain
/// <summary>
/// Creates a toolchain instance for the given platform.
/// </summary>
/// <param name="Platform">The platform to create a toolchain for</param>
/// <returns>New toolchain instance.</returns>
public override UEToolChain CreateToolChain(CPPTargetPlatform Platform)
{
return new IOSToolChain(ProjectFile, this);
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:9,代码来源:UEBuildIOS.cs
示例17: UEToolChain
public UEToolChain(CPPTargetPlatform InCppPlatform)
{
CppPlatform = InCppPlatform;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:4,代码来源:UEToolChain.cs
示例18: ShouldUsePDBFiles
/**
* Whether PDB files should be used
*
* @param InPlatform The CPPTargetPlatform being built
* @param InConfiguration The CPPTargetConfiguration being built
* @param bInCreateDebugInfo true if debug info is getting create, false if not
*
* @return bool true if PDB files should be used, false if not
*/
public override bool ShouldUsePDBFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, bool bCreateDebugInfo)
{
// Only supported on PC.
if (bCreateDebugInfo && ShouldUseIncrementalLinking(Platform, Configuration))
{
return true;
}
return false;
}
开发者ID:ErwinT6,项目名称:T6Engine,代码行数:18,代码来源:UEBuildWindows.cs
示例19: ShouldUsePDBFiles
/**
* Whether PDB files should be used
*
* @param InPlatform The CPPTargetPlatform being built
* @param InConfiguration The CPPTargetConfiguration being built
* @param bInCreateDebugInfo true if debug info is getting create, false if not
*
* @return bool true if PDB files should be used, false if not
*/
public override bool ShouldUsePDBFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration, bool bCreateDebugInfo)
{
return true;
}
开发者ID:colwalder,项目名称:unrealengine,代码行数:13,代码来源:UEBuildWinRT.cs
示例20: ShouldUsePCHFiles
public override bool ShouldUsePCHFiles(CPPTargetPlatform Platform, CPPTargetConfiguration Configuration)
{
return true;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:4,代码来源:UEBuildAndroid.cs
注:本文中的CPPTargetPlatform类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论