public CompilerPanel(CProject project) { this.Build(); this.project = project; compilers = AddinManager.GetExtensionObjects("/CBinding/Compilers"); foreach (ICompiler compiler in compilers) { compilerComboBox.AppendText(compiler.Name); } int active = 0; Gtk.TreeIter iter; Gtk.ListStore store = (Gtk.ListStore)compilerComboBox.Model; store.GetIterFirst(out iter); while (store.IterIsValid(iter)) { if ((string)store.GetValue(iter, 0) == project.Compiler.Name) { break; } store.IterNext(ref iter); active++; } compilerComboBox.Active = active; useCcacheCheckBox.Active = ((CProjectConfiguration)project.GetConfiguration(IdeApp.Workspace.ActiveConfiguration)).UseCcache; Update(); }
public CompilerPanel (CProject project) { this.Build (); this.project = project; compilers = AddinManager.GetExtensionObjects ("/CBinding/Compilers"); foreach (ICompiler compiler in compilers) { compilerComboBox.AppendText (compiler.Name); } int active = 0; Gtk.TreeIter iter; Gtk.ListStore store = (Gtk.ListStore)compilerComboBox.Model; store.GetIterFirst (out iter); while (store.IterIsValid (iter)) { if ((string)store.GetValue (iter, 0) == project.Compiler.Name) { break; } store.IterNext (ref iter); active++; } compilerComboBox.Active = active; useCcacheCheckBox.Active = ((CProjectConfiguration)project.GetConfiguration (IdeApp.Workspace.ActiveConfiguration)).UseCcache; Update (); }
protected override void Clean(IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration) { base.Clean(monitor, entry, configuration); CProject project = (CProject)entry; CProjectConfiguration conf = (CProjectConfiguration)project.GetConfiguration(configuration); project.Compiler.Clean(project.Files, conf, monitor); }
protected override BuildResult Build(IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration) { CProject project = (CProject)entry; CProjectConfiguration conf = (CProjectConfiguration)project.GetConfiguration(configuration); if (conf.CompileTarget != CompileTarget.Bin) { project.WriteMDPkgPackage(configuration); } return(base.Build(monitor, entry, configuration)); }
private List <Package> GetPackagesOfProjects(Project project) { List <Package> packages = new List <Package>(); Package package; foreach (SolutionFolderItem c in project.ParentFolder.Items) { if (null != c && c is CProject) { CProject cproj = (CProject)c; CProjectConfiguration conf = (CProjectConfiguration)cproj.GetConfiguration(IdeApp.Workspace.ActiveConfiguration); if (conf.CompileTarget != CompileTarget.Exe) { cproj.WriteMDPkgPackage(conf.Selector); package = new Package(cproj); packages.Add(package); } } } return(packages); }
/// <summary> /// Gets the command line arguments. Use with caution, when the project is not fully loaded and there are no active configuration yet, it will fail with nullrefexception. /// </summary> /// <value>The arguments.</value> public string [] CmdArguments(string name) { var compiler = new ClangCCompiler(); var active_configuration = (CProjectConfiguration)project.GetConfiguration(IdeApp.Workspace.ActiveConfiguration); var args = new List <string> (compiler.GetCompilerFlagsAsArray(project, active_configuration)); if (CProject.SourceExtensions.Any(o => o.Equals(new FilePath(name).Extension.ToUpper()))) { foreach (var f in project.Files) { if (CProject.HeaderExtensions.Any(o => o.Equals(f.FilePath.Extension.ToUpper()))) { if (File.Exists(f.Name + ".pch")) { args.Add("-include-pch"); args.Add(f.Name + ".pch"); } } } } return(args.ToArray()); }