Example #1
0
    public override void CompileDynamicLibrary(string outputFile, IEnumerable <string> sources, IEnumerable <string> includePaths, IEnumerable <string> libraries, IEnumerable <string> libraryPaths)
    {
        // ISSUE: object of a compiler-generated type is created
        // ISSUE: variable of a compiler-generated type
        MSVCCompiler.\u003CCompileDynamicLibrary\u003Ec__AnonStorey75 libraryCAnonStorey75 = new MSVCCompiler.\u003CCompileDynamicLibrary\u003Ec__AnonStorey75();
        // ISSUE: reference to a compiler-generated field
        libraryCAnonStorey75.\u003C\u003Ef__this = this;
        string[] array = sources.ToArray <string>();
        string   str1  = NativeCompiler.Aggregate(((IEnumerable <string>)array).Select <string, string>(new Func <string, string>(((NativeCompiler)this).ObjectFileFor)), " \"", "\" " + Environment.NewLine);

        // ISSUE: reference to a compiler-generated field
        libraryCAnonStorey75.includePathsString = NativeCompiler.Aggregate(includePaths.Union <string>((IEnumerable <string>) this.m_IncludePaths), "/I \"", "\" ");
        string str2 = NativeCompiler.Aggregate(libraries.Union <string>((IEnumerable <string>) this.m_Libraries), " ", " ");
        string str3 = NativeCompiler.Aggregate(libraryPaths.Union <string>((IEnumerable <string>) this.m_Settings.LibPaths), "/LIBPATH:\"", "\" ");

        this.GenerateEmptyPdbFile(outputFile);
        // ISSUE: reference to a compiler-generated method
        NativeCompiler.ParallelFor <string>(array, new Action <string>(libraryCAnonStorey75.\u003C\u003Em__108));
        string contents     = string.Format(" {0} {1} {2} /DEBUG /INCREMENTAL:NO /MACHINE:{4} /DLL /out:\"{3}\" /MAP /DEF:\"{5}\" ", (object)str1, (object)str2, (object)str3, (object)outputFile, (object)this.m_Settings.MachineSpecification, (object)this.m_DefFile);
        string tempFileName = Path.GetTempFileName();

        File.WriteAllText(tempFileName, contents);
        this.Execute(string.Format("@{0}", (object)tempFileName), "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin\\link.exe");
        this.ExecuteCommand(Path.Combine(MonoInstallationFinder.GetFrameWorksFolder(), "Tools/MapFileParser/MapFileParser.exe"), "-format=MSVC", "\"" + Path.GetFullPath(Path.Combine(Path.GetDirectoryName(outputFile), Path.GetFileNameWithoutExtension(outputFile) + ".map")) + "\"", "\"" + Path.GetFullPath(Path.Combine(Path.GetDirectoryName(outputFile), "SymbolMap")) + "\"");
    }
 public override void CompileDynamicLibrary(string outputFile, IEnumerable<string> sources, IEnumerable<string> includePaths, IEnumerable<string> libraries, IEnumerable<string> libraryPaths)
 {
   // ISSUE: object of a compiler-generated type is created
   // ISSUE: variable of a compiler-generated type
   MSVCCompiler.\u003CCompileDynamicLibrary\u003Ec__AnonStorey75 libraryCAnonStorey75 = new MSVCCompiler.\u003CCompileDynamicLibrary\u003Ec__AnonStorey75();
   // ISSUE: reference to a compiler-generated field
   libraryCAnonStorey75.\u003C\u003Ef__this = this;
   string[] array = sources.ToArray<string>();
   string str1 = NativeCompiler.Aggregate(((IEnumerable<string>) array).Select<string, string>(new Func<string, string>(((NativeCompiler) this).ObjectFileFor)), " \"", "\" " + Environment.NewLine);
   // ISSUE: reference to a compiler-generated field
   libraryCAnonStorey75.includePathsString = NativeCompiler.Aggregate(includePaths.Union<string>((IEnumerable<string>) this.m_IncludePaths), "/I \"", "\" ");
   string str2 = NativeCompiler.Aggregate(libraries.Union<string>((IEnumerable<string>) this.m_Libraries), " ", " ");
   string str3 = NativeCompiler.Aggregate(libraryPaths.Union<string>((IEnumerable<string>) this.m_Settings.LibPaths), "/LIBPATH:\"", "\" ");
   this.GenerateEmptyPdbFile(outputFile);
   // ISSUE: reference to a compiler-generated method
   NativeCompiler.ParallelFor<string>(array, new Action<string>(libraryCAnonStorey75.\u003C\u003Em__108));
   string contents = string.Format(" {0} {1} {2} /DEBUG /INCREMENTAL:NO /MACHINE:{4} /DLL /out:\"{3}\" /MAP /DEF:\"{5}\" ", (object) str1, (object) str2, (object) str3, (object) outputFile, (object) this.m_Settings.MachineSpecification, (object) this.m_DefFile);
   string tempFileName = Path.GetTempFileName();
   File.WriteAllText(tempFileName, contents);
   this.Execute(string.Format("@{0}", (object) tempFileName), "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin\\link.exe");
   this.ExecuteCommand(Path.Combine(MonoInstallationFinder.GetFrameWorksFolder(), "Tools/MapFileParser/MapFileParser.exe"), "-format=MSVC", "\"" + Path.GetFullPath(Path.Combine(Path.GetDirectoryName(outputFile), Path.GetFileNameWithoutExtension(outputFile) + ".map")) + "\"", "\"" + Path.GetFullPath(Path.Combine(Path.GetDirectoryName(outputFile), "SymbolMap")) + "\"");
 }