public override void SetupSdkOptions(IGenerationContext context) { var options = context.Options; var devEnv = context.DevelopmentEnvironment; if (GlobalSettings.OverridenDurangoXDK && !Util.IsDurangoSideBySideXDK() && Util.IsDurangoSideBySideXDKInstalled()) { // only use the full path to includes and libs if we have a // sideByside XDK installed, but we compile using an old one. // That is done because msbuild concatenates an XdkEdition in the $(Console*) variables without any way of removing it... options["IncludePath"] = devEnv.GetDurangoIncludePath(); options["ReferencePath"] = devEnv.GetDurangoLibraryPath(); options["LibraryPath"] = devEnv.GetDurangoLibraryPath(); options["LibraryWPath"] = devEnv.GetDurangoLibraryPath(); } else { options["IncludePath"] = "$(Console_SdkIncludeRoot);"; options["ReferencePath"] = "$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath);"; options["LibraryPath"] = "$(Console_SdkLibPath);"; options["LibraryWPath"] = "$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath);"; } //Options.Vc.General.DeployMode. // Push DeployMode="Push" // Pull DeployMode="Pull" // External DeployMode="External" context.SelectOption ( Sharpmake.Options.Option(Options.General.DeployMode.Push, () => { context.Options["DeployMode"] = FileGeneratorUtilities.RemoveLineTag; }), Sharpmake.Options.Option(Options.General.DeployMode.Pull, () => { context.Options["DeployMode"] = "Pull"; }), Sharpmake.Options.Option(Options.General.DeployMode.External, () => { context.Options["DeployMode"] = "External"; }) ); }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { if (GlobalSettings.OverridenDurangoXDK) { string durangoXdkKitPath = FileGeneratorUtilities.RemoveLineTag; string xdkEditionTarget = FileGeneratorUtilities.RemoveLineTag; string targetPlatformSdkPath = FileGeneratorUtilities.RemoveLineTag; string durangoXdkCompilers = FileGeneratorUtilities.RemoveLineTag; string gameOSFilePath = FileGeneratorUtilities.RemoveLineTag; string durangoXdkTasks = FileGeneratorUtilities.RemoveLineTag; string targetPlatformIdentifier = FileGeneratorUtilities.RemoveLineTag; if (!Util.IsDurangoSideBySideXDK()) { durangoXdkKitPath = Sharpmake.Util.EnsureTrailingSeparator(Path.Combine(GlobalSettings.DurangoXDK, "xdk")); // Set only if the machine has a SideBySide XDK installed, but we don't generate for one if (Util.IsDurangoSideBySideXDKInstalled()) { if (context.ProjectConfigurations.Any(conf => !conf.IsFastBuild)) { durangoXdkCompilers = durangoXdkKitPath; } gameOSFilePath = Path.Combine(GlobalSettings.DurangoXDK, "sideload", "era.xvd"); // Use the tasks of the system durangoXdkTasks = Sharpmake.Util.EnsureTrailingSeparator(Path.Combine(Util.GetDurangoXDKInstallPath(), Util.GetLatestDurangoSideBySideXDKInstalled(), "PC", "tasks")); targetPlatformIdentifier = "Xbox.xdk"; } } else { xdkEditionTarget = GlobalSettings.XdkEditionTarget; targetPlatformSdkPath = Util.GetDurangoExtensionXDK(); } using (generator.Declare("durangoXdkInstallPath", GlobalSettings.DurangoXDK)) using (generator.Declare("sdkReferenceDirectoryRoot", GlobalSettings.XboxOneExtensionSDK)) using (generator.Declare("durangoXdkKitPath", durangoXdkKitPath)) using (generator.Declare("xdkEditionTarget", xdkEditionTarget)) using (generator.Declare("targetPlatformSdkPath", targetPlatformSdkPath)) using (generator.Declare("durangoXdkCompilers", durangoXdkCompilers)) using (generator.Declare("gameOSFilePath", gameOSFilePath)) using (generator.Declare("durangoXdkTasks", durangoXdkTasks)) using (generator.Declare("targetPlatformIdentifier", targetPlatformIdentifier)) using (generator.Declare("xdkEditionRootVS2015", GlobalSettings.XdkEditionRootVS2015 ?? FileGeneratorUtilities.RemoveLineTag)) { generator.Write(_projectDescriptionPlatformSpecific); } } }
public override void SetupSdkOptions(IGenerationContext context) { var options = context.Options; var devEnv = context.DevelopmentEnvironment; // TODO: check if we need to override the paths in case of FastBuild? if (GlobalSettings.OverridenDurangoXDK && !Util.IsDurangoSideBySideXDK() && Util.IsDurangoSideBySideXDKInstalled()) { // only use the full path to includes and libs if we have a // sideByside XDK installed, but we compile using an old one. // That is done because msbuild concatenates an XdkEdition in the $(Console*) variables without any way of removing it... options["IncludePath"] = devEnv.GetDurangoIncludePath(); options["ReferencePath"] = devEnv.GetDurangoLibraryPath(); options["LibraryPath"] = devEnv.GetDurangoLibraryPath(); options["LibraryWPath"] = devEnv.GetDurangoLibraryPath(); } else { options["IncludePath"] = "$(Console_SdkIncludeRoot);"; options["ReferencePath"] = "$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath);"; options["LibraryPath"] = "$(Console_SdkLibPath);"; options["LibraryWPath"] = "$(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath);"; } //Options.Vc.General.DeployMode. // Push DeployMode="Push" // Pull DeployMode="Pull" // External DeployMode="External" context.Options["NetworkSharePath"] = FileGeneratorUtilities.RemoveLineTag; context.SelectOption ( Sharpmake.Options.Option(Options.General.DeployMode.Push, () => { context.Options["DeployMode"] = FileGeneratorUtilities.RemoveLineTag; }), Sharpmake.Options.Option(Options.General.DeployMode.Pull, () => { context.Options["DeployMode"] = "Pull"; }), Sharpmake.Options.Option(Options.General.DeployMode.External, () => { context.Options["DeployMode"] = "External"; }), Sharpmake.Options.Option(Options.General.DeployMode.RegisterNetworkShare, () => { context.Options["DeployMode"] = "RegisterNetworkShare"; string networkSharePath = Sharpmake.Options.PathOption.Get <Durango.Options.General.NetworkSharePath>(context.Configuration, null); if (networkSharePath != null) { context.Options["NetworkSharePath"] = "$(ProjectDir)" + Sharpmake.Util.PathGetRelative(context.ProjectDirectoryCapitalized, networkSharePath, true); } }) ); }
public override void GeneratePlatformSpecificProjectDescription(IVcxprojGenerationContext context, IFileGenerator generator) { if (GlobalSettings.OverridenDurangoXDK) { string durangoXdkKitPath = FileGeneratorUtilities.RemoveLineTag; string xdkEditionTarget = FileGeneratorUtilities.RemoveLineTag; string targetPlatformSdkPath = FileGeneratorUtilities.RemoveLineTag; string durangoXdkCompilers = FileGeneratorUtilities.RemoveLineTag; string gameOSFilePath = FileGeneratorUtilities.RemoveLineTag; string durangoXdkTasks = FileGeneratorUtilities.RemoveLineTag; string targetPlatformIdentifier = FileGeneratorUtilities.RemoveLineTag; string platformFolder = MSBuildGlobalSettings.GetCppPlatformFolder(context.DevelopmentEnvironmentsRange.MinDevEnv, Platform.durango); string xdkEditionRootVS2015 = FileGeneratorUtilities.RemoveLineTag; string xdkEditionRootVS2017 = FileGeneratorUtilities.RemoveLineTag; string enableLegacyXdkHeaders = FileGeneratorUtilities.RemoveLineTag; if (!Util.IsDurangoSideBySideXDK()) { durangoXdkKitPath = Sharpmake.Util.EnsureTrailingSeparator(Path.Combine(GlobalSettings.DurangoXDK, "xdk")); // Set only if the machine has a SideBySide XDK installed, but we don't generate for one if (Util.IsDurangoSideBySideXDKInstalled()) { if (context.ProjectConfigurations.Any(conf => !conf.IsFastBuild)) { durangoXdkCompilers = durangoXdkKitPath; } gameOSFilePath = Path.Combine(GlobalSettings.DurangoXDK, "sideload", "era.xvd"); // Use the tasks of the system durangoXdkTasks = Sharpmake.Util.EnsureTrailingSeparator(Path.Combine(Util.GetDurangoXDKInstallPath(), Util.GetLatestDurangoSideBySideXDKInstalled(), "PC", "tasks")); targetPlatformIdentifier = "Xbox.xdk"; } } else { xdkEditionTarget = GlobalSettings.XdkEditionTarget; targetPlatformSdkPath = Util.GetDurangoExtensionXDK(); } generator.Write(Vcxproj.Template.Project.ProjectDescriptionStartPlatformConditional); { if (!string.IsNullOrEmpty(platformFolder)) { using (generator.Declare("custompropertyname", "_PlatformFolder")) using (generator.Declare("custompropertyvalue", Sharpmake.Util.EnsureTrailingSeparator(platformFolder))) // _PlatformFolder require the path to end with a "\" generator.Write(Vcxproj.Template.Project.CustomProperty); } if (DevEnv.vs2015 >= context.DevelopmentEnvironmentsRange.MinDevEnv && DevEnv.vs2015 <= context.DevelopmentEnvironmentsRange.MaxDevEnv) { var vs2015PlatformFolder = MSBuildGlobalSettings.GetCppPlatformFolder(DevEnv.vs2015, Platform.durango); if (!string.IsNullOrEmpty(vs2015PlatformFolder)) { xdkEditionRootVS2015 = vs2015PlatformFolder; } } if (DevEnv.vs2017 >= context.DevelopmentEnvironmentsRange.MinDevEnv && DevEnv.vs2017 <= context.DevelopmentEnvironmentsRange.MaxDevEnv) { var vs2017PlatformFolder = MSBuildGlobalSettings.GetCppPlatformFolder(DevEnv.vs2017, Platform.durango); if (!string.IsNullOrEmpty(vs2017PlatformFolder)) { xdkEditionRootVS2017 = vs2017PlatformFolder; } int xdkEdition; bool isMinFeb2018Xdk = Util.TryParseXdkEditionTarget(GlobalSettings.XdkEditionTarget, out xdkEdition) && xdkEdition >= GlobalSettings._feb2018XdkEditionTarget; if (GlobalSettings.EnableLegacyXdkHeaders && isMinFeb2018Xdk) { enableLegacyXdkHeaders = "true"; } } using (generator.Declare("durangoXdkInstallPath", GlobalSettings.DurangoXDK)) using (generator.Declare("sdkReferenceDirectoryRoot", GlobalSettings.XboxOneExtensionSDK)) using (generator.Declare("durangoXdkKitPath", durangoXdkKitPath)) using (generator.Declare("xdkEditionTarget", xdkEditionTarget)) using (generator.Declare("targetPlatformSdkPath", targetPlatformSdkPath)) using (generator.Declare("durangoXdkCompilers", durangoXdkCompilers)) using (generator.Declare("gameOSFilePath", gameOSFilePath)) using (generator.Declare("durangoXdkTasks", durangoXdkTasks)) using (generator.Declare("targetPlatformIdentifier", targetPlatformIdentifier)) using (generator.Declare("xdkEditionRootVS2015", xdkEditionRootVS2015)) using (generator.Declare("xdkEditionRootVS2017", xdkEditionRootVS2017)) using (generator.Declare("enableLegacyXdkHeaders", enableLegacyXdkHeaders)) { generator.Write(_projectDescriptionPlatformSpecific); } } generator.Write(Vcxproj.Template.Project.PropertyGroupEnd); } }