예제 #1
0
    public override void CompileDynamicLibrary(string outputFile, IEnumerable <string> sources, IEnumerable <string> includePaths, IEnumerable <string> libraries, IEnumerable <string> libraryPaths)
    {
        string[] array = sources.ToArray <string>();
        string   text  = NativeCompiler.Aggregate(array.Select(new Func <string, string>(base.ObjectFileFor)), " ", " " + Environment.NewLine);
        string   includePathsString = NativeCompiler.Aggregate(includePaths.Union(this.m_IncludePaths), "/I \"", "\" ");
        string   text2 = NativeCompiler.Aggregate(libraries.Union(this.m_Libraries), " ", " ");
        string   text3 = NativeCompiler.Aggregate(libraryPaths.Union(this.m_Settings.LibPaths), "/LIBPATH:\"", "\" ");

        this.GenerateEmptyPdbFile(outputFile);
        NativeCompiler.ParallelFor <string>(array, delegate(string file)
        {
            this.Compile(file, includePathsString);
        });
        string contents = string.Format(" {0} {1} {2} /DEBUG /INCREMENTAL:NO /MACHINE:{4} /DLL /out:\"{3}\" /DEF:\"{5}\" ", new object[]
        {
            text,
            text2,
            text3,
            outputFile,
            this.m_Settings.MachineSpecification,
            this.m_DefFile
        });
        string tempFileName = Path.GetTempFileName();

        File.WriteAllText(tempFileName, contents);
        base.Execute(string.Format("@{0}", tempFileName), "C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\bin\\link.exe");
    }
예제 #2
0
    public override void CompileDynamicLibrary(string outFile, IEnumerable <string> sources, IEnumerable <string> includePaths, IEnumerable <string> libraries, IEnumerable <string> libraryPaths)
    {
        string[] array       = sources.ToArray <string>();
        string   includeDirs = includePaths.Aggregate(string.Empty, (string current, string sourceDir) => current + "-I" + sourceDir + " ");
        string   text        = NativeCompiler.Aggregate(libraries, "-force_load ", " ");
        string   text2       = NativeCompiler.Aggregate(libraryPaths.Union(this.m_Settings.LibPaths), "-L", " ");

        NativeCompiler.ParallelFor <string>(array, delegate(string file)
        {
            this.Compile(file, includeDirs);
        });
        string arg_11A_1 = "ld";

        string[] expr_95 = new string[9];
        expr_95[0] = "-dylib";
        expr_95[1] = "-arch " + this.m_Settings.MachineSpecification;
        expr_95[2] = "-macosx_version_min 10.6";
        expr_95[3] = "-lSystem";
        expr_95[4] = "-lstdc++";
        expr_95[5] = "-o " + outFile;
        expr_95[6] = array.Select(new Func <string, string>(base.ObjectFileFor)).Aggregate((string buff, string s) => buff + " " + s);
        expr_95[7] = text2;
        expr_95[8] = text;
        base.ExecuteCommand(arg_11A_1, expr_95);
    }
예제 #3
0
        public override void CompileDynamicLibrary(string outFile, 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
            GccCompiler.\u003CCompileDynamicLibrary\u003Ec__AnonStorey73 libraryCAnonStorey73 = new GccCompiler.\u003CCompileDynamicLibrary\u003Ec__AnonStorey73();
            // ISSUE: reference to a compiler-generated field
            libraryCAnonStorey73.\u003C\u003Ef__this = this;
            string[] array = sources.ToArray <string>();
            // ISSUE: reference to a compiler-generated field
            libraryCAnonStorey73.includeDirs = includePaths.Aggregate <string, string>(string.Empty, (Func <string, string, string>)((current, sourceDir) => current + "-I" + sourceDir + " "));
            string empty = string.Empty;
            string str   = NativeCompiler.Aggregate(libraryPaths.Union <string>((IEnumerable <string>) this.m_Settings.LibPaths), "-L", " ");

            // ISSUE: reference to a compiler-generated method
            NativeCompiler.ParallelFor <string>(array, new System.Action <string>(libraryCAnonStorey73.\u003C\u003Em__FD));
            this.ExecuteCommand(this.m_Settings.LinkerPath, string.Format("-shared {0} -o {1}", (object)this.m_Settings.MachineSpecification, (object)outFile), ((IEnumerable <string>)array).Where <string>(new Func <string, bool>(NativeCompiler.IsSourceFile)).Select <string, string>(new Func <string, string>(((NativeCompiler)this).ObjectFileFor)).Aggregate <string>((Func <string, string, string>)((buff, s) => buff + " " + s)), str, empty);
        }
예제 #4
0
        public override void CompileDynamicLibrary(string outFile, IEnumerable <string> sources, IEnumerable <string> includePaths, IEnumerable <string> libraries, IEnumerable <string> libraryPaths)
        {
            string[] array       = sources.ToArray <string>();
            string   includeDirs = includePaths.Aggregate(string.Empty, (string current, string sourceDir) => current + "-I" + sourceDir + " ");
            string   empty       = string.Empty;
            string   text        = NativeCompiler.Aggregate(libraryPaths.Union(this.m_Settings.LibPaths), "-L", " ");

            NativeCompiler.ParallelFor <string>(array, delegate(string file)
            {
                this.Compile(file, includeDirs);
            });
            string arg_F7_1 = this.m_Settings.LinkerPath;

            string[] expr_8E = new string[4];
            expr_8E[0] = string.Format("-shared {0} -o {1}", this.m_Settings.MachineSpecification, outFile);
            expr_8E[1] = array.Where(new Func <string, bool>(NativeCompiler.IsSourceFile)).Select(new Func <string, string>(base.ObjectFileFor)).Aggregate((string buff, string s) => buff + " " + s);
            expr_8E[2] = text;
            expr_8E[3] = empty;
            base.ExecuteCommand(arg_F7_1, expr_8E);
        }
예제 #5
0
    public override void CompileDynamicLibrary(string outFile, 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
        ClangCompiler.\u003CCompileDynamicLibrary\u003Ec__AnonStorey71 libraryCAnonStorey71 = new ClangCompiler.\u003CCompileDynamicLibrary\u003Ec__AnonStorey71();
        // ISSUE: reference to a compiler-generated field
        libraryCAnonStorey71.\u003C\u003Ef__this = this;
        string[] array = sources.ToArray <string>();
        // ISSUE: reference to a compiler-generated field
        libraryCAnonStorey71.includeDirs = includePaths.Aggregate <string, string>(string.Empty, (Func <string, string, string>)((current, sourceDir) => current + "-I" + sourceDir + " "));
        string str1 = NativeCompiler.Aggregate(libraries, "-force_load ", " ");
        string str2 = NativeCompiler.Aggregate(libraryPaths.Union <string>((IEnumerable <string>) this.m_Settings.LibPaths), "-L", " ");

        // ISSUE: reference to a compiler-generated method
        NativeCompiler.ParallelFor <string>(array, new Action <string>(libraryCAnonStorey71.\u003C\u003Em__F8));
        string str3 = "\"" + Path.GetFullPath(Path.Combine(Path.GetDirectoryName(outFile), Path.GetFileNameWithoutExtension(outFile) + ".map")) + "\"";

        this.ExecuteCommand("ld", "-dylib", "-arch " + this.m_Settings.MachineSpecification, "-macosx_version_min 10.6", "-lSystem", "-lstdc++", "-map", str3, "-o " + outFile, ((IEnumerable <string>)array).Select <string, string>(new Func <string, string>(((NativeCompiler)this).ObjectFileFor)).Aggregate <string>((Func <string, string, string>)((buff, s) => buff + " " + s)), str2, str1);
        string command = Path.Combine(MonoInstallationFinder.GetFrameWorksFolder(), "Tools/MapFileParser/MapFileParser");
        string str4    = "\"" + Path.GetFullPath(Path.Combine(Path.GetDirectoryName(outFile), "SymbolMap")) + "\"";

        this.ExecuteCommand(command, "-format=Clang", str3, str4);
    }
예제 #6
0
    public override void CompileDynamicLibrary(string outputFile, IEnumerable <string> sources, IEnumerable <string> includePaths, IEnumerable <string> libraries, IEnumerable <string> libraryPaths)
    {
        string[] array = sources.ToArray <string>();
        string   text  = NativeCompiler.Aggregate(array.Select(new Func <string, string>(base.ObjectFileFor)), " \"", "\" " + Environment.NewLine);
        string   includePathsString = NativeCompiler.Aggregate(includePaths.Union(this.m_IncludePaths), "/I \"", "\" ");
        string   text2 = NativeCompiler.Aggregate(libraries.Union(this.m_Libraries), " ", " ");
        string   text3 = NativeCompiler.Aggregate(libraryPaths.Union(this.m_Settings.LibPaths), "/LIBPATH:\"", "\" ");

        this.GenerateEmptyPdbFile(outputFile);
        NativeCompiler.ParallelFor <string>(array, delegate(string file)
        {
            this.Compile(file, includePathsString);
        });
        string contents = string.Format(" {0} {1} {2} /DEBUG /INCREMENTAL:NO /MACHINE:{4} /DLL /out:\"{3}\" /MAP /DEF:\"{5}\" ", new object[]
        {
            text,
            text2,
            text3,
            outputFile,
            this.m_Settings.MachineSpecification,
            this.m_DefFile
        });
        string tempFileName = Path.GetTempFileName();

        File.WriteAllText(tempFileName, contents);
        base.Execute(string.Format("@{0}", tempFileName), MSVCCompiler.VisualStudioDir() + "\\bin\\link.exe");
        string command = Path.Combine(MonoInstallationFinder.GetFrameWorksFolder(), "Tools/MapFileParser/MapFileParser.exe");
        string text4   = "\"" + Path.GetFullPath(Path.Combine(Path.GetDirectoryName(outputFile), Path.GetFileNameWithoutExtension(outputFile) + ".map")) + "\"";
        string text5   = "\"" + Path.GetFullPath(Path.Combine(Path.GetDirectoryName(outputFile), "SymbolMap")) + "\"";

        base.ExecuteCommand(command, new string[]
        {
            "-format=MSVC",
            text4,
            text5
        });
    }
예제 #7
0
    public override void CompileDynamicLibrary(string outFile, IEnumerable <string> sources, IEnumerable <string> includePaths, IEnumerable <string> libraries, IEnumerable <string> libraryPaths)
    {
        string[] array       = sources.ToArray <string>();
        string   includeDirs = includePaths.Aggregate(string.Empty, (string current, string sourceDir) => current + "-I" + sourceDir + " ");
        string   text        = NativeCompiler.Aggregate(libraries, "-force_load ", " ");
        string   text2       = NativeCompiler.Aggregate(libraryPaths.Union(this.m_Settings.LibPaths), "-L", " ");

        NativeCompiler.ParallelFor <string>(array, delegate(string file)
        {
            this.Compile(file, includeDirs);
        });
        string text3     = "\"" + Path.GetFullPath(Path.Combine(Path.GetDirectoryName(outFile), Path.GetFileNameWithoutExtension(outFile) + ".map")) + "\"";
        string arg_15C_1 = "ld";

        string[] expr_C9 = new string[11];
        expr_C9[0]  = "-dylib";
        expr_C9[1]  = "-arch " + this.m_Settings.MachineSpecification;
        expr_C9[2]  = "-macosx_version_min 10.6";
        expr_C9[3]  = "-lSystem";
        expr_C9[4]  = "-lstdc++";
        expr_C9[5]  = "-map";
        expr_C9[6]  = text3;
        expr_C9[7]  = "-o " + outFile;
        expr_C9[8]  = array.Select(new Func <string, string>(base.ObjectFileFor)).Aggregate((string buff, string s) => buff + " " + s);
        expr_C9[9]  = text2;
        expr_C9[10] = text;
        base.ExecuteCommand(arg_15C_1, expr_C9);
        string command = Path.Combine(MonoInstallationFinder.GetFrameWorksFolder(), "Tools/MapFileParser/MapFileParser");
        string text4   = "\"" + Path.GetFullPath(Path.Combine(Path.GetDirectoryName(outFile), "SymbolMap")) + "\"";

        base.ExecuteCommand(command, new string[]
        {
            "-format=Clang",
            text3,
            text4
        });
    }