From cd97e2d8c6ded0a92a91c067fee4dfa534092479 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Thu, 19 Nov 2015 10:35:05 -0800 Subject: [PATCH] Replacing TABs with SPACEs in WindowsLinkStep --- .../Windows/WindowsLinkStep.cs | 198 +++++++++--------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsLinkStep.cs b/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsLinkStep.cs index 56a798567..91b59ee74 100644 --- a/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsLinkStep.cs +++ b/src/Microsoft.DotNet.Tools.Compiler.Native/IntermediateCompilation/Windows/WindowsLinkStep.cs @@ -10,19 +10,19 @@ using Microsoft.DotNet.Tools.Common; namespace Microsoft.DotNet.Tools.Compiler.Native { - public class WindowsLinkStep : IPlatformNativeStep - { - private readonly string LinkerName = "link.exe"; - private readonly string LinkerOutputExtension = ".exe"; + public class WindowsLinkStep : IPlatformNativeStep + { + private readonly string LinkerName = "link.exe"; + private readonly string LinkerOutputExtension = ".exe"; private readonly string VSBin = "..\\..\\VC\\bin\\amd64"; private readonly string InputExtension = ".obj"; private static readonly Dictionary ConfigurationLinkerOptionsMap = new Dictionary - { - { BuildConfiguration.debug, "/NOLOGO /ERRORREPORT:PROMPT /MANIFEST /MANIFESTUAC:\"level='asInvoker' uiAccess='false'\" /manifest:embed /Debug /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT" }, - { BuildConfiguration.release, "/NOLOGO /ERRORREPORT:PROMPT /INCREMENTAL:NO /OPT:REF /OPT:ICF /LTCG:incremental /MANIFEST /MANIFESTUAC:\"level='asInvoker' uiAccess='false'\" /manifest:embed /Debug /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT" } - }; + { + { BuildConfiguration.debug, "/NOLOGO /ERRORREPORT:PROMPT /MANIFEST /MANIFESTUAC:\"level='asInvoker' uiAccess='false'\" /manifest:embed /Debug /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT" }, + { BuildConfiguration.release, "/NOLOGO /ERRORREPORT:PROMPT /INCREMENTAL:NO /OPT:REF /OPT:ICF /LTCG:incremental /MANIFEST /MANIFESTUAC:\"level='asInvoker' uiAccess='false'\" /manifest:embed /Debug /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT" } + }; private static readonly Dictionary ModeLibMap = new Dictionary { @@ -48,108 +48,108 @@ namespace Microsoft.DotNet.Tools.Compiler.Native private static readonly Dictionary ConfigurationLinkLibMap = new Dictionary() { - { BuildConfiguration.debug , new string[] { "msvcrtd.lib" } }, - { BuildConfiguration.release , new string[] { "msvcrt.lib" } } + { BuildConfiguration.debug , new string[] { "msvcrtd.lib" } }, + { BuildConfiguration.release , new string[] { "msvcrt.lib" } } }; - - private string ArgStr { get; set; } - private NativeCompileSettings config; - - public WindowsLinkStep(NativeCompileSettings config) - { - this.config = config; - InitializeArgs(config); - } - - public int Invoke() - { - var result = WindowsCommon.SetVCVars(); - if (result != 0) - { - Reporter.Error.WriteLine("vcvarsall.bat invocation failed."); - return result; - } - - result = InvokeLinker(); - if (result != 0) - { + + private string ArgStr { get; set; } + private NativeCompileSettings config; + + public WindowsLinkStep(NativeCompileSettings config) + { + this.config = config; + InitializeArgs(config); + } + + public int Invoke() + { + var result = WindowsCommon.SetVCVars(); + if (result != 0) + { + Reporter.Error.WriteLine("vcvarsall.bat invocation failed."); + return result; + } + + result = InvokeLinker(); + if (result != 0) + { Reporter.Error.WriteLine("Linking of intermediate files failed."); - } - return result; - } - - public bool CheckPreReqs() - { + } + return result; + } + + public bool CheckPreReqs() + { var vcInstallDir = Environment.GetEnvironmentVariable("VS140COMNTOOLS"); return !string.IsNullOrEmpty(vcInstallDir); } - - private void InitializeArgs(NativeCompileSettings config) - { - var argsList = new List(); - - // Configuration Based Linker Options - argsList.Add(ConfigurationLinkerOptionsMap[config.BuildType]); - - //Output - var outFile = DetermineOutputFile(config); - argsList.Add($"/out:\"{outFile}\""); - - // Constant Libs - argsList.Add(string.Join(" ", ConstantLinkLibs)); + + private void InitializeArgs(NativeCompileSettings config) + { + var argsList = new List(); + + // Configuration Based Linker Options + argsList.Add(ConfigurationLinkerOptionsMap[config.BuildType]); + + //Output + var outFile = DetermineOutputFile(config); + argsList.Add($"/out:\"{outFile}\""); + + // Constant Libs + argsList.Add(string.Join(" ", ConstantLinkLibs)); // SDK Libs var SDKLibs = ModeLibMap[config.NativeMode]; - foreach (var lib in SDKLibs) - { - argsList.Add(Path.Combine(config.IlcPath, lib)); - } + foreach (var lib in SDKLibs) + { + argsList.Add(Path.Combine(config.IlcPath, lib)); + } - // Configuration Based Libs - var configLibs = ConfigurationLinkLibMap[config.BuildType]; - foreach (var lib in configLibs) - { - argsList.Add(lib); - } + // Configuration Based Libs + var configLibs = ConfigurationLinkLibMap[config.BuildType]; + foreach (var lib in configLibs) + { + argsList.Add(lib); + } - // Link Libs - foreach(var path in config.LinkLibPaths){ - argsList.Add($"\"{path}\""); - } - - //arch - argsList.Add($"/MACHINE:{config.Architecture}"); + // Link Libs + foreach(var path in config.LinkLibPaths){ + argsList.Add($"\"{path}\""); + } + + //arch + argsList.Add($"/MACHINE:{config.Architecture}"); //Input Obj file var inputFile = DetermineInputFile(config); - argsList.Add($"\"{inputFile}\""); - - this.ArgStr = string.Join(" ", argsList); - } - - private int InvokeLinker() - { - var vcInstallDir = Environment.GetEnvironmentVariable("VS140COMNTOOLS"); - var linkerPath = Path.Combine(vcInstallDir, VSBin, LinkerName); - - var result = Command.Create(linkerPath, ArgStr) - .ForwardStdErr() - .ForwardStdOut() - .Execute(); - - return result.ExitCode; - } - - public string DetermineOutputFile(NativeCompileSettings config) - { - var outputDirectory = config.OutputDirectory; - - var filename = Path.GetFileNameWithoutExtension(config.InputManagedAssemblyPath); - - var outFile = Path.Combine(outputDirectory, filename + LinkerOutputExtension); - - return outFile; - } + argsList.Add($"\"{inputFile}\""); + + this.ArgStr = string.Join(" ", argsList); + } + + private int InvokeLinker() + { + var vcInstallDir = Environment.GetEnvironmentVariable("VS140COMNTOOLS"); + var linkerPath = Path.Combine(vcInstallDir, VSBin, LinkerName); + + var result = Command.Create(linkerPath, ArgStr) + .ForwardStdErr() + .ForwardStdOut() + .Execute(); + + return result.ExitCode; + } + + public string DetermineOutputFile(NativeCompileSettings config) + { + var outputDirectory = config.OutputDirectory; + + var filename = Path.GetFileNameWithoutExtension(config.InputManagedAssemblyPath); + + var outFile = Path.Combine(outputDirectory, filename + LinkerOutputExtension); + + return outFile; + } private string DetermineInputFile(NativeCompileSettings config) { @@ -161,6 +161,6 @@ namespace Microsoft.DotNet.Tools.Compiler.Native return infile; } - - } + + } } \ No newline at end of file