示例#1
0
            public override void AddCompilerSettings(
                IDictionary <string, CompilerSettings> masterCompilerSettings,
                string compilerName,
                string rootPath,
                DevEnv devEnv,
                string projectRootPath
                )
            {
                var fastBuildCompilerSettings = PlatformRegistry.Get <IWindowsFastBuildCompilerSettings>(Platform.win64);

                if (!fastBuildCompilerSettings.BinPath.ContainsKey(devEnv))
                {
                    fastBuildCompilerSettings.BinPath.Add(devEnv, devEnv.GetVisualStudioBinPath(Platform.win64));
                }
                if (!fastBuildCompilerSettings.LinkerPath.ContainsKey(devEnv))
                {
                    fastBuildCompilerSettings.LinkerPath.Add(devEnv, fastBuildCompilerSettings.BinPath[devEnv]);
                }
                if (!fastBuildCompilerSettings.ResCompiler.ContainsKey(devEnv))
                {
                    fastBuildCompilerSettings.ResCompiler.Add(devEnv, devEnv.GetWindowsResourceCompiler(Platform.win64));
                }

                CompilerSettings compilerSettings = GetMasterCompilerSettings(masterCompilerSettings, compilerName, rootPath, devEnv, projectRootPath, false);

                compilerSettings.PlatformFlags |= Platform.win64;
                SetConfiguration(compilerSettings.Configurations, string.Empty, projectRootPath, devEnv, false);
            }
示例#2
0
            public override void SetConfiguration(IDictionary <string, CompilerSettings.Configuration> configurations, string compilerName, string projectRootPath, DevEnv devEnv, bool useCCompiler)
            {
                string configName = ".win64Config";

                if (!configurations.ContainsKey(configName))
                {
                    var    fastBuildCompilerSettings = PlatformRegistry.Get <IWindowsFastBuildCompilerSettings>(Platform.win64);
                    string binPath;
                    if (!fastBuildCompilerSettings.BinPath.TryGetValue(devEnv, out binPath))
                    {
                        binPath = devEnv.GetVisualStudioBinPath(Platform.win64);
                    }

                    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";
                    }

                    string resCompiler;
                    if (!fastBuildCompilerSettings.ResCompiler.TryGetValue(devEnv, out resCompiler))
                    {
                        resCompiler = devEnv.GetWindowsResourceCompiler(Platform.win64);
                    }

                    configurations.Add(
                        configName,
                        new CompilerSettings.Configuration(
                            Platform.win64,
                            binPath: Util.GetCapitalizedPath(Util.PathGetAbsolute(projectRootPath, binPath)),
                            linkerPath: Util.GetCapitalizedPath(Util.PathGetAbsolute(projectRootPath, linkerPath)),
                            resourceCompiler: Util.GetCapitalizedPath(Util.PathGetAbsolute(projectRootPath, resCompiler)),
                            librarian: Path.Combine(@"$LinkerPath$", librarianExe),
                            linker: Path.Combine(@"$LinkerPath$", linkerExe)
                            )
                        );

                    configurations.Add(
                        ".win64ConfigMasm",
                        new CompilerSettings.Configuration(
                            Platform.win64,
                            compiler: @"$BinPath$\ml64.exe",
                            usingOtherConfiguration: @".win64Config"
                            )
                        );
                }
            }
示例#3
0
            private void SetConfiguration(
                Project.Configuration conf,
                IDictionary <string, CompilerSettings.Configuration> configurations,
                string configName,
                string projectRootPath,
                DevEnv devEnv,
                bool useCCompiler)
            {
                if (configurations.ContainsKey(configName))
                {
                    return;
                }

                string linkerPathOverride   = null;
                string linkerExeOverride    = null;
                string librarianExeOverride = null;

                GetLinkerExecutableInfo(conf, out linkerPathOverride, out linkerExeOverride, out librarianExeOverride);

                var    fastBuildCompilerSettings = PlatformRegistry.Get <IWindowsFastBuildCompilerSettings>(Platform.win64);
                string binPath;

                if (!fastBuildCompilerSettings.BinPath.TryGetValue(devEnv, out binPath))
                {
                    binPath = devEnv.GetVisualStudioBinPath(Platform.win64);
                }

                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";
                }

                string resCompiler;

                if (!fastBuildCompilerSettings.ResCompiler.TryGetValue(devEnv, out resCompiler))
                {
                    resCompiler = devEnv.GetWindowsResourceCompiler(Platform.win64);
                }

                string capitalizedBinPath = Util.GetCapitalizedPath(Util.PathGetAbsolute(projectRootPath, binPath));

                configurations.Add(
                    configName,
                    new CompilerSettings.Configuration(
                        Platform.win64,
                        binPath: capitalizedBinPath,
                        linkerPath: Util.GetCapitalizedPath(Util.PathGetAbsolute(projectRootPath, linkerPath)),
                        resourceCompiler: Util.GetCapitalizedPath(Util.PathGetAbsolute(projectRootPath, resCompiler)),
                        librarian: Path.Combine(@"$LinkerPath$", librarianExe),
                        linker: Path.Combine(@"$LinkerPath$", linkerExe)
                        )
                    );

                string masmConfigurationName = configName + "Masm";
                var    masmConfiguration     = new CompilerSettings.Configuration(
                    Platform.win64,
                    compiler: "ML" + masmConfigurationName,
                    usingOtherConfiguration: configName
                    );

                masmConfiguration.Masm = Path.Combine(capitalizedBinPath, "ml64.exe");

                configurations.Add(
                    masmConfigurationName,
                    masmConfiguration
                    );
            }