/// <summary> /// Return the platform toolset string to write into the project configuration /// </summary> /// <param name="InPlatform"> The UnrealTargetPlatform being built</param> /// <param name="InConfiguration"> The UnrealTargetConfiguration being built</param> /// <param name="InProjectFileFormat">The version of Visual Studio to target</param> /// <returns>string The custom configuration section for the project file; Empty string if it doesn't require one</returns> public override string GetVisualStudioPlatformToolsetString(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration, VCProjectFileFormat InProjectFileFormat) { if (IsVSAndroidSupportInstalled() || !IsNsightInstalled(InProjectFileFormat)) { return("\t\t<PlatformToolset>" + VCProjectFileGenerator.GetProjectFilePlatformToolsetVersionString(InProjectFileFormat) + "</PlatformToolset>" + ProjectFileGenerator.NewLine); } return("\t\t<PlatformToolset>" + VCProjectFileGenerator.GetProjectFilePlatformToolsetVersionString(InProjectFileFormat) + "</PlatformToolset>" + ProjectFileGenerator.NewLine + "\t\t<AndroidNativeAPI>UseTarget</AndroidNativeAPI>" + ProjectFileGenerator.NewLine); }
/// <summary> /// Return the platform toolset string to write into the project configuration /// </summary> /// <param name="InPlatform"> The UnrealTargetPlatform being built</param> /// <param name="InConfiguration"> The UnrealTargetConfiguration being built</param> /// <param name="InProjectFileFormat">The version of Visual Studio to target</param> /// <param name="ProjectFileBuilder">String builder for the project file</param> /// <returns>string The custom configuration section for the project file; Empty string if it doesn't require one</returns> public override void GetVisualStudioPlatformToolsetString(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration, VCProjectFileFormat InProjectFileFormat, StringBuilder ProjectFileBuilder) { if (IsVSAndroidSupportInstalled() || !IsNsightInstalled(InProjectFileFormat)) { ProjectFileBuilder.AppendLine(" <PlatformToolset>" + VCProjectFileGenerator.GetProjectFilePlatformToolsetVersionString(InProjectFileFormat) + "</PlatformToolset>"); } else { ProjectFileBuilder.AppendLine(" <PlatformToolset>" + VCProjectFileGenerator.GetProjectFilePlatformToolsetVersionString(InProjectFileFormat) + "</PlatformToolset>"); ProjectFileBuilder.AppendLine(" <AndroidNativeAPI>UseTarget</AndroidNativeAPI>"); } }
/// <summary> /// Check to see if a recent enough version of Nsight is installed. /// </summary> bool IsNsightInstalled(VCProjectFileFormat ProjectFileFormat) { // cache the results since this gets called a number of times if (CheckedForNsight) { return(NsightInstalled); } CheckedForNsight = true; // NOTE: there is now a registry key that we can use instead at: // HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\NVIDIA Corporation\Nsight Tegra\Version string ProgramFilesPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); string PlatformToolsetVersion = VCProjectFileGenerator.GetProjectFilePlatformToolsetVersionString(ProjectFileFormat); if (String.IsNullOrEmpty(PlatformToolsetVersion)) { // future maintainer: add toolset version and verify that the rest of the msbuild path, version, and location in ProgramFiles(x86) is still valid Log.TraceInformation("Android project generation needs to be updated for this version of Visual Studio."); return(false); } // build the path to where the Nsight DLL we'll be checking should sit string NsightDllPath = Path.Combine(ProgramFilesPath, @"MSBuild\Microsoft.Cpp\v4.0", PlatformToolsetVersion, @"Platforms\Tegra-Android\Nvidia.Build.CPPTasks.Tegra-Android.Extensibility.dll"); if (!File.Exists(NsightDllPath)) { return(false); } // grab the version info from the DLL FileVersionInfo NsightVersion = FileVersionInfo.GetVersionInfo(NsightDllPath); if (NsightVersion.ProductMajorPart > 3) { // Mark as Nsight 3.1 (project will be updated) NsightVersionCode = 11; NsightInstalled = true; } else if (NsightVersion.ProductMajorPart == 3) { // Nsight 3.0 supported NsightVersionCode = 9; NsightInstalled = true; if (NsightVersion.ProductMinorPart >= 1) { // Nsight 3.1+ should be valid (will update project if newer) NsightVersionCode = 11; } } else if (NsightVersion.ProductMajorPart == 2) { // Nsight 2.0+ should be valid NsightVersionCode = 6; NsightInstalled = true; } else if ((NsightVersion.ProductMajorPart == 1) && (NsightVersion.ProductMinorPart >= 5)) { // Nsight 1.5+ should be valid NsightVersionCode = 6; NsightInstalled = true; } if (!NsightInstalled) { Log.TraceInformation("\nNsight Tegra {0}.{1} found, but Nsight Tegra 1.5 or higher is required for debugging support.", NsightVersion.ProductMajorPart, NsightVersion.ProductMinorPart); } return(NsightInstalled); }
/// <summary> /// Return the platform toolset string to write into the project configuration /// </summary> /// <param name="InPlatform"> The UnrealTargetPlatform being built</param> /// <param name="InConfiguration"> The UnrealTargetConfiguration being built</param> /// <param name="InProjectFileFormat"> The verison of VS</param> /// <param name="ProjectFileBuilder">String builder for the project file</param> /// <returns>string The custom configuration section for the project file; Empty string if it doesn't require one</returns> public override void GetVisualStudioPlatformToolsetString(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration, VCProjectFileFormat InProjectFileFormat, StringBuilder ProjectFileBuilder) { ProjectFileBuilder.AppendLine(" <PlatformToolset>" + VCProjectFileGenerator.GetProjectFilePlatformToolsetVersionString(InProjectFileFormat) + "</PlatformToolset>"); }
/// <summary> /// Return the platform toolset string to write into the project configuration /// </summary> /// <param name="InPlatform"> The UnrealTargetPlatform being built</param> /// <param name="InConfiguration"> The UnrealTargetConfiguration being built</param> /// <param name="InProjectFileFormat"> The verison of VS</param> /// <returns>string The custom configuration section for the project file; Empty string if it doesn't require one</returns> public override string GetVisualStudioPlatformToolsetString(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration, VCProjectFileFormat InProjectFileFormat) { return("\t\t<PlatformToolset>" + VCProjectFileGenerator.GetProjectFilePlatformToolsetVersionString(InProjectFileFormat) + "</PlatformToolset>" + ProjectFileGenerator.NewLine); }