public override void SetConfiguration(IDictionary <string, CompilerSettings.Configuration> configurations, string compilerName, string projectRootPath, DevEnv devEnv, bool useCCompiler) { string configName = ".durangoConfig"; if (!configurations.ContainsKey(configName)) { var fastBuildCompilerSettings = PlatformRegistry.Get <IFastBuildCompilerSettings>(Platform.durango); string binPath; if (!fastBuildCompilerSettings.BinPath.TryGetValue(devEnv, out binPath)) { binPath = devEnv.GetDurangoBinPath(); } string linkerPath; if (!fastBuildCompilerSettings.LinkerPath.TryGetValue(devEnv, out linkerPath)) { linkerPath = binPath; } string linkerExe; if (!fastBuildCompilerSettings.LinkerExe.TryGetValue(devEnv, out linkerExe)) { linkerExe = "link.exe"; } string librarianExe; if (!fastBuildCompilerSettings.LibrarianExe.TryGetValue(devEnv, out librarianExe)) { librarianExe = "lib.exe"; } configurations.Add( configName, new CompilerSettings.Configuration( Platform.durango, binPath: Sharpmake.Util.GetCapitalizedPath(Sharpmake.Util.PathGetAbsolute(projectRootPath, binPath)), linkerPath: Sharpmake.Util.GetCapitalizedPath(Sharpmake.Util.PathGetAbsolute(projectRootPath, linkerPath)), librarian: Path.Combine(@"$LinkerPath$", librarianExe), linker: Path.Combine(@"$LinkerPath$", linkerExe) ) ); configurations.Add( ".durangoConfigMasm", new CompilerSettings.Configuration( Platform.durango, compiler: @"$BinPath$\ml64.exe", usingOtherConfiguration: configName ) ); } }
public override void AddCompilerSettings( IDictionary <string, CompilerSettings> masterCompilerSettings, string compilerName, string rootPath, DevEnv devEnv, string projectRootPath ) { var fastBuildCompilerSettings = PlatformRegistry.Get <IFastBuildCompilerSettings>(Platform.durango); if (!fastBuildCompilerSettings.BinPath.ContainsKey(devEnv)) { fastBuildCompilerSettings.BinPath.Add(devEnv, devEnv.GetDurangoBinPath()); } if (!fastBuildCompilerSettings.LinkerPath.ContainsKey(devEnv)) { fastBuildCompilerSettings.LinkerPath.Add(devEnv, fastBuildCompilerSettings.BinPath[devEnv]); } switch (devEnv) { case DevEnv.vs2012: { CompilerSettings compilerSettings = GetMasterCompilerSettings(masterCompilerSettings, compilerName, rootPath, devEnv, projectRootPath, false); compilerSettings.PlatformFlags |= Platform.durango; SetConfiguration(compilerSettings.Configurations, string.Empty, projectRootPath, devEnv, false); } break; case DevEnv.vs2015: case DevEnv.vs2017: { var win64PlatformSettings = PlatformRegistry.Get <IPlatformBff>(Platform.win64); string overrideName = devEnv == DevEnv.vs2015 ? "Compiler-x64-v140-vs2015" : "Compiler-x64-v141-vs2017"; CompilerSettings compilerSettings = win64PlatformSettings.GetMasterCompilerSettings(masterCompilerSettings, overrideName, rootPath, devEnv, projectRootPath, false); compilerSettings.PlatformFlags |= Platform.durango; SetConfiguration(compilerSettings.Configurations, string.Empty, projectRootPath, devEnv, false); } break; default: throw new NotImplementedException("This devEnv (" + devEnv + ") is not supported!"); } }
private void SetConfiguration( Project.Configuration conf, IDictionary <string, CompilerSettings.Configuration> configurations, string configName, string projectRootPath, DevEnv devEnv, bool useCCompiler ) { string linkerPathOverride = null; string linkerExeOverride = null; string librarianExeOverride = null; GetLinkerExecutableInfo(conf, out linkerPathOverride, out linkerExeOverride, out librarianExeOverride); if (!configurations.ContainsKey(configName)) { var fastBuildCompilerSettings = PlatformRegistry.Get <IFastBuildCompilerSettings>(Platform.durango); string binPath; if (!fastBuildCompilerSettings.BinPath.TryGetValue(devEnv, out binPath)) { binPath = devEnv.GetDurangoBinPath(); } string linkerPath; if (!string.IsNullOrEmpty(linkerPathOverride)) { linkerPath = linkerPathOverride; } else if (!fastBuildCompilerSettings.LinkerPath.TryGetValue(devEnv, out linkerPath)) { linkerPath = binPath; } string linkerExe; if (!string.IsNullOrEmpty(linkerExeOverride)) { linkerExe = linkerExeOverride; } else if (!fastBuildCompilerSettings.LinkerExe.TryGetValue(devEnv, out linkerExe)) { linkerExe = "link.exe"; } string librarianExe; if (!string.IsNullOrEmpty(librarianExeOverride)) { librarianExe = librarianExeOverride; } else if (!fastBuildCompilerSettings.LibrarianExe.TryGetValue(devEnv, out librarianExe)) { librarianExe = "lib.exe"; } configurations.Add( configName, new CompilerSettings.Configuration( Platform.durango, binPath: Sharpmake.Util.GetCapitalizedPath(Sharpmake.Util.PathGetAbsolute(projectRootPath, binPath)), linkerPath: Sharpmake.Util.GetCapitalizedPath(Sharpmake.Util.PathGetAbsolute(projectRootPath, linkerPath)), librarian: Path.Combine(@"$LinkerPath$", librarianExe), linker: Path.Combine(@"$LinkerPath$", linkerExe) ) ); configurations.Add( configName + "Masm", new CompilerSettings.Configuration( Platform.durango, compiler: @"$BinPath$\ml64.exe", usingOtherConfiguration: configName ) ); } }