.*)", RegexOptions.Compiled);
-
-
- public string GetCompiledOutputName(string fileName)
- {
- return Path.ChangeExtension(fileName, ".exe");
- }
-
- public string GetCompiledOutputName(IProject project)
- {
- CPPCompilerParameters compilerparameters = (CPPCompilerParameters)project.ActiveConfiguration;
- return compilerparameters.OutputFile;
- }
-
- public bool CanCompile(string fileName)
- {
- return Path.GetExtension(fileName) == ".cpp" || Path.GetExtension(fileName) == ".c" || Path.GetExtension(fileName) == ".cxx";
- }
-
- public ICompilerResult CompileFile(string filename, CPPCompilerParameters compilerparameters)
- {
-
- if (!CanCompile(filename))
- {
- MessageBox.Show("File " + filename + " is not a source file.", "Compilation Error", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
- return new DefaultCompilerResult(new CompilerResults(new TempFileCollection()), "");
- }
- string output = "";
- string error = "";
- string exe = Path.ChangeExtension(filename, ".exe");
- if (compilerparameters.OutputAssembly != null && compilerparameters.OutputAssembly.Length > 0) {
- exe = compilerparameters.OutputAssembly;
- }
- _treatWarningsAsErrors = compilerparameters.TreatWarningsAsErrors;
- string responseFileName = Path.GetTempFileName();
-
- StreamWriter writer = new StreamWriter(responseFileName);
-
- writer.WriteLine("/nologo");
- if (compilerparameters.UseManagedExtensions)
- {
- writer.WriteLine("/clr");
- }
- writer.WriteLine("/Fe\"" + exe + "\"");
-
- writer.WriteLine('"' + filename + '"');
-
- TempFileCollection tf = new TempFileCollection();
-
- writer.Close();
-
- string compilerName = GetCompilerName();
- string outstr = compilerName + " \"@" + responseFileName + "\"";
- string currDir = Directory.GetCurrentDirectory();
- string intDir = compilerparameters.IntermediateDirectory;
- if (intDir == null || intDir.Length == 0) {
- intDir = compilerparameters.OutputDirectory;
- }
-
- Directory.SetCurrentDirectory(intDir);
- ICompilerResult result;
- try {
- Executor.ExecWaitWithCapture(outstr, currDir, tf, ref output, ref error);
- result = ParseOutput(tf, output, error);
- }
- catch (System.Runtime.InteropServices.ExternalException e) {
- ShowErrorBox(e);
- result = CreateErrorCompilerResult(tf, e);
- }
- finally {
- File.Delete(responseFileName);
- File.Delete(output);
- File.Delete(error);
- Directory.SetCurrentDirectory(currDir);
- }
- return result;
- }
-
- private void ShowErrorBox(System.Runtime.InteropServices.ExternalException e)
- {
- MessageBox.Show("It seems cl.exe is not installed or not found.\n\nInstall compiler and set PATH environment variable.\n\nException: " + e, "Compile Error", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
- }
-
- public ICompilerResult CompileProject(IProject project, bool force)
- {
- _inputFiles = new StringBuilder();
- _buildProcess = new StringBuilder();
- _results = new StringBuilder();
-
- CPPProject p = (CPPProject)project;
- CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration;
- _treatWarningsAsErrors = compilerparameters.TreatWarningsAsErrors;
-
- CheckDirectory(Path.GetDirectoryName(compilerparameters.OutputFile));
- CheckDirectory(Path.GetDirectoryName(compilerparameters.IntermediateDirectory));
-
- StringBuilder output = new StringBuilder();
-
- ICompilerResult result;
-
- if (compilerparameters.PreCompileHeader) {
- result = InternalCompileProject(p, true, force);
- if (result != null) {
- output.Append(result.CompilerOutput);
- if (HasErrors(result)) {
- goto exit;
- }
- }
- }
-
- result = InternalCompileProject(p, false, force);
- if (result != null) {
- output.Append(result.CompilerOutput);
- if (HasErrors(result)) {
- goto exit;
- }
- }
- if (result != null || !File.Exists(Path.GetFullPath(compilerparameters.OutputFile))) {
- result = LinkProject(p);
- output.Append(result.CompilerOutput);
- }
- exit:
- WriteResultFile(p);
- CompilerResults cr = result != null ? result.CompilerResults : new CompilerResults(new TempFileCollection());
- return new DefaultCompilerResult(cr, output.ToString());
- }
-
- private bool HasErrors(ICompilerResult compilerResult)
- {
- bool result = false;
- if (compilerResult.CompilerResults.Errors.Count > 0)
- {
- if (_treatWarningsAsErrors)
- {
- result = true;
- }
- else {
- foreach (CompilerError error in compilerResult.CompilerResults.Errors)
- {
- if (!error.IsWarning)
- {
- result = true;
- break;
- }
- }
- }
- }
- return result;
- }
-
- private void CheckDirectory(string directory)
- {
- if (!Directory.Exists(directory)) {
- Directory.CreateDirectory(directory);
- }
- }
-
- private void WriteResultFile(CPPProject p)
- {
- CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration;
- string directory = Path.GetDirectoryName(compilerparameters.OutputFile);
- string resultFile = Path.Combine(directory, "BuildLog.html");
- _results.Append("writing result file to : " + resultFile);
-
- StreamWriter writer = new StreamWriter(resultFile);
- writer.Write("");
- writer.Write("Build Log from: " + p.Name + "(" + compilerparameters.Name + ") |
");
- writer.Write("Build started.");
- writer.Write("");
- writer.WriteLine(_inputFiles.ToString());
-
- writer.Write("");
- writer.Write("");
- writer.WriteLine(_buildProcess.ToString());
- writer.Write("
");
-
- writer.Write("");
- writer.Write("");
- writer.WriteLine(_results.ToString());
- writer.Write("
");
- writer.Write("Build finished.");
- writer.Write("");
- writer.Close();
- }
-
- #region COMPILER
- private string GetCompilerName()
- {
- return @"cl.exe";
- }
-
- private string WriteCompilerParameters(CPPProject p, bool preCompiledHeader, bool force)
- {
- CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration;
- StringBuilder sb = new StringBuilder();
-
- sb.Append("/c\n");
-
- if (compilerparameters.UseManagedExtensions) {
- sb.Append("/clr\n");
- }
- string directory = Path.GetDirectoryName(compilerparameters.OutputFile);
- sb.Append("/Fo\"");
- sb.Append(directory);
- sb.Append("/\"\n");
-
- IProjectService projectService = (IProjectService)ICSharpCode.Core.ServiceManager.Services.GetService(typeof(IProjectService));
- ArrayList allProjects = Combine.GetAllProjects(projectService.CurrentOpenCombine);
- if (preCompiledHeader) {
- sb.Append(compilerparameters.GetPreCompiledHeaderOptions());
- } else {
- sb.Append(compilerparameters.GetCompilerOptions());
- }
- if (compilerparameters.AdditionalCompilerOptions != null && compilerparameters.AdditionalCompilerOptions.Length > 0) {
- foreach (string option in compilerparameters.AdditionalCompilerOptions.Split(';')) {
- sb.Append(option);
- sb.Append("\n");
- }
- }
-
- foreach (ProjectReference lib in p.ProjectReferences) {
- sb.Append("/FU\"");
- sb.Append(lib.GetReferencedFileName(p));
- sb.Append("\"\n");
- }
-
- switch (compilerparameters.ConfigurationType) {
- case ConfigurationType.Dll:
- sb.Append("/LD\n");
- break;
- }
- bool includedFile = false;
- foreach (ProjectFile finfo in p.ProjectFiles) {
- if (finfo.Subtype != Subtype.Directory) {
- switch (finfo.BuildAction) {
- case BuildAction.Compile:
- if (CanCompile(finfo.Name))
- {
- string fileName = Path.GetFileNameWithoutExtension(Path.GetFullPath(finfo.Name)).ToLower();
- string headerFile = Path.GetFileNameWithoutExtension(compilerparameters.preCompiledHeaderCPPOptions.HeaderFile).ToLower();
- bool isPreHeader = fileName == headerFile;
-
- if (!(preCompiledHeader ^ isPreHeader)) {
- if (force || ShouldCompileFile(p, finfo.Name)) {
- includedFile = true;
- sb.Append("\"");
- sb.Append(Path.GetFullPath(finfo.Name));
- sb.Append("\"\n");
- }
- }
- }
- break;
- }
- }
- }
- if (!includedFile) {
- return null;
- }
- string responseFileName = Path.GetTempFileName();
- StreamWriter writer = new StreamWriter(responseFileName, false);
-// string standardIncludes = Environment.GetEnvironmentVariable("INCLUDE");
-// if (standardIncludes != null && standardIncludes.Length > 0) {
-// writer.WriteLine("/I\"" + standardIncludes + "\"");
-// }
-
- writer.Write(sb.ToString());
- writer.Close();
-
- _inputFiles.Append("Creating temporary file ");
- _inputFiles.Append(responseFileName);
- _inputFiles.Append(" with following content:
");
- _inputFiles.Append("");
- _inputFiles.Append(sb.ToString());
- _inputFiles.Append("
");
-
- return responseFileName;
- }
-
- Hashtable lastCompiledFiles = new Hashtable();
-
- private bool ShouldCompileFile(CPPProject p, string fileName)
- {
- CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration;
- string directory = Path.GetDirectoryName(compilerparameters.OutputFile);
- string objectFile = Path.Combine(directory, Path.ChangeExtension(Path.GetFileName(fileName), ".obj"));
- if (!File.Exists(objectFile)) {
- return true;
- }
-
- string[] additinalIncludeDirs = compilerparameters.AdditionalCompilerOptions.Split(';');
- ArrayList dirs = new ArrayList(additinalIncludeDirs.Length+1);
- dirs.Add(Path.GetDirectoryName(fileName));
- foreach (string dir in additinalIncludeDirs)
- {
- dirs.Add(dir);
- }
-
- DateTime lastWriteTime = new IncludeParser(fileName, dirs, true).Parse().GetLastWriteTime();
-// DateTime lastWriteTime = File.GetLastWriteTime(fileName);
-
- bool shouldCompile;
- if (lastCompiledFiles[fileName] == null) {
- shouldCompile = true;
- } else {
- shouldCompile = lastWriteTime != (DateTime)lastCompiledFiles[fileName];
- }
-
- lastCompiledFiles[fileName] = lastWriteTime;
- return shouldCompile;
- }
-
- private ICompilerResult InternalCompileProject(CPPProject p, bool preCompiledHeader, bool force)
- {
- CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration;
-
- string responseFileName = WriteCompilerParameters(p, preCompiledHeader, force);
- if (responseFileName == null) {
- return null;
- }
- string output = String.Empty;
- string error = String.Empty;
-
- string compilerName = GetCompilerName();
- string clstr = compilerName + " \"@" + responseFileName + "\"";
-
- TempFileCollection tf = new TempFileCollection();
-
- string currDir = Directory.GetCurrentDirectory();
- string intDir = compilerparameters.IntermediateDirectory;
- if (intDir == null || intDir.Length == 0) {
- intDir = compilerparameters.OutputDirectory;
- }
- _inputFiles.Append("Executing command: " + clstr + "
");
-
- ICompilerResult result;
- try {
- Executor.ExecWaitWithCapture(clstr, tf, ref output, ref error);
- result = ParseOutput(tf, output, error);
- }
- catch (System.Runtime.InteropServices.ExternalException e) {
- ShowErrorBox(e);
- result = CreateErrorCompilerResult(tf, e);
- }
- finally {
- File.Delete(responseFileName);
- File.Delete(output);
- File.Delete(error);
- }
-
- return result;
- }
- #endregion
-
- #region LINKER
- private string GetLinkerName()
- {
- return @"link.exe";
- }
-
- private string WriteLinkerOptions(CPPProject p)
- {
- CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration;
-
- StringBuilder sb = new StringBuilder();
-
- string exe = compilerparameters.OutputFile;
- string dir = Path.GetDirectoryName(Path.GetFullPath(exe));
- sb.Append("/OUT:\"");sb.Append(exe);sb.Append("\"\n");
- foreach (ProjectFile finfo in p.ProjectFiles) {
- if (finfo.Subtype != Subtype.Directory) {
- switch (finfo.BuildAction) {
- case BuildAction.Compile:
- if (CanCompile(finfo.Name))
- {
- sb.Append('"');
- sb.Append(Path.Combine(dir,
- Path.ChangeExtension(Path.GetFileName(finfo.Name),
- ".obj")));
- sb.Append("\"\n");
- }
- break;
- case BuildAction.EmbedAsResource:
- sb.Append("/ASSEMBLYRESOURCE:\"");sb.Append(Path.GetFullPath(finfo.Name));sb.Append("\"\n");
- break;
- }
- }
- }
- switch (compilerparameters.ConfigurationType) {
- case ConfigurationType.Dll:
- sb.Append("/DLL\n");
- break;
- }
-
- sb.Append(compilerparameters.GetLinkerOptionsForCompiler());
-
- // write to response file
- string responseFileName = Path.GetTempFileName();
- StreamWriter writer = new StreamWriter(responseFileName);
-// string standardLibs = Environment.GetEnvironmentVariable("LIB");
-// if (standardLibs != null && standardLibs.Length > 0) {
-// foreach (string lib in standardLibs.Split(';')) {
-// if (lib.Length > 0) {
-// writer.WriteLine("/LIBPATH:\"" + lib + "\"");
-// }
-// }
-// }
- writer.Write(sb.ToString());
- writer.Close();
-
- _inputFiles.Append("Creating temporary file " + responseFileName + " with following content:
");
- _inputFiles.Append("");
- _inputFiles.Append(sb.ToString());
- _inputFiles.Append("
");
- return responseFileName;
- }
-
- private ICompilerResult LinkProject(CPPProject p)
- {
- CPPCompilerParameters compilerparameters = (CPPCompilerParameters)p.ActiveConfiguration;
-
- string responseFileName = WriteLinkerOptions(p);
-
- string output = String.Empty;
- string error = String.Empty;
-
- string compilerName = GetLinkerName();
- string clstr = compilerName + " \"@" + responseFileName + "\"";
-
- TempFileCollection tf = new TempFileCollection();
-
- string currDir = Directory.GetCurrentDirectory();
- string intDir = compilerparameters.IntermediateDirectory;
- if (intDir == null || intDir.Length == 0) {
- intDir = compilerparameters.OutputDirectory;
- }
-
- _inputFiles.Append("Executing command : ");
- _inputFiles.Append(clstr);
- _inputFiles.Append("
");
- Executor.ExecWaitWithCapture(clstr, tf, ref output, ref error);
-
- ICompilerResult result = ParseOutput(tf, output, error);
-
-// File.Delete(responseFileName);
- File.Delete(output);
- File.Delete(error);
-
- return result;
- }
- #endregion
-
- private ICompilerResult CreateErrorCompilerResult(TempFileCollection tf, System.Runtime.InteropServices.ExternalException e)
- {
- CompilerError error = new CompilerError();
- error.Line = 0;
- error.FileName = "";
- error.IsWarning = false;
- error.ErrorNumber = "";
- error.ErrorText = e.Message;
- CompilerResults cr = new CompilerResults(tf);
- cr.Errors.Add(error);
- return new DefaultCompilerResult(cr, "");
- }
-
- private void InternalParseOutputFile(StringBuilder compilerOutput, CompilerResults cr, string file)
- {
- StreamReader sr = new StreamReader(File.OpenRead(file), Encoding.Default);
-
- // skip fist whitespace line
- sr.ReadLine();
-
-
- while (true) {
- string curLine = sr.ReadLine();
- _buildProcess.Append(curLine);
- _buildProcess.Append("\n");
- compilerOutput.Append(curLine);
- compilerOutput.Append('\n');
- if (curLine == null) {
- break;
- }
- curLine = curLine.Trim();
- if (curLine.Length == 0) {
- continue;
- }
-
- CompilerError error = new CompilerError();
-
- // try to match standard errors
- Match match = normalError.Match(curLine);
- if (match.Success) {
- error.Line = Int32.Parse(match.Result("${line}"));
- try {
- error.FileName = Path.GetFullPath(match.Result("${file}"));
- } catch (Exception) {
- error.FileName = "";
- }
- error.IsWarning = match.Result("${error}").EndsWith("warning");
- error.ErrorNumber = match.Result("${number}");
- error.ErrorText = match.Result("${message}");
- } else {
- match = generalError.Match(curLine); // try to match general csc errors
- if (match.Success) {
- error.IsWarning = match.Result("${error}").EndsWith("warning");
- error.ErrorNumber = match.Result("${number}");
- error.ErrorText = match.Result("${message}");
- } else { // give up and skip the line
- continue;
- }
- }
-
- cr.Errors.Add(error);
- }
- sr.Close();
- }
-
- private ICompilerResult ParseOutput(TempFileCollection tf, string outputFile, string errorFile)
- {
- StringBuilder compilerOutput = new StringBuilder();
- CompilerResults cr = new CompilerResults(tf);
- InternalParseOutputFile(compilerOutput, cr, outputFile);
- InternalParseOutputFile(compilerOutput, cr, errorFile);
- return new DefaultCompilerResult(cr, compilerOutput.ToString());
- }
- }
-}
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetBindingExecutionManager.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetBindingExecutionManager.cs
deleted file mode 100644
index 054795f8b3..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetBindingExecutionManager.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-//
-//
-//
-//
-//
-
-using System;
-using System.IO;
-using System.Diagnostics;
-using System.Collections;
-using System.Reflection;
-using System.Resources;
-using System.Windows.Forms;
-using System.Xml;
-using System.CodeDom.Compiler;
-using System.Threading;
-
-using ICSharpCode.SharpDevelop.Internal.Project;
-using ICSharpCode.SharpDevelop.Gui;
-
-using ICSharpCode.Core;
-
-namespace CPPBinding
-{
- ///
- /// This class describes the main functionalaty of a language codon
- ///
- public class CPPBindingExecutionManager
- {
- public void Execute(string filename, bool debug)
- {
- string exe = Path.ChangeExtension(filename, ".exe");
- ProcessStartInfo psi = new ProcessStartInfo(Environment.GetEnvironmentVariable("ComSpec"), "/c " + "\"" + exe + "\"" + " & pause");
- psi.WorkingDirectory = Path.GetDirectoryName(exe);
- psi.UseShellExecute = false;
- try {
- Process p = new Process();
- p.StartInfo = psi;
- p.Start();
- } catch (Exception) {
- throw new ApplicationException("Can't execute " + "\"" + exe + "\"\n(.NET bug? Try restaring SD or manual start)");
- }
- }
-
- public void Execute(IProject project, bool debug)
- {
- CPPCompilerParameters parameters = (CPPCompilerParameters)project.ActiveConfiguration;
-
-
- string exe = ((CPPCompilerParameters)project.ActiveConfiguration).OutputFile;
-
- //string args = ((CPPCompilerParameters)project.ActiveConfiguration).CommandLineParameters;
- string args = "";
-
- ProcessStartInfo psi;
- string runtimeStarter = String.Empty;
-
- psi = new ProcessStartInfo(runtimeStarter + "\"" + exe + "\"");
- psi.Arguments = args;
-
- try {
- psi.WorkingDirectory = Path.GetDirectoryName(exe);
- psi.UseShellExecute = false;
-
- Process p = new Process();
- p.StartInfo = psi;
- p.Start();
- } catch (Exception) {
- throw new ApplicationException("Can't execute " + "\"" + exe + "\"");
- }
- }
- }
-}
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetLanguageBinding.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetLanguageBinding.cs
deleted file mode 100644
index 5aabddf21c..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/CPPNetLanguageBinding.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-//
-//
-//
-//
-//
-
-using System;
-using System.IO;
-using System.Diagnostics;
-using System.Collections;
-using System.Reflection;
-using System.Resources;
-using System.Windows.Forms;
-using System.Xml;
-using System.CodeDom.Compiler;
-using System.Threading;
-
-using ICSharpCode.SharpDevelop.Internal.Project;
-using ICSharpCode.SharpDevelop.Internal.Templates;
-using ICSharpCode.SharpDevelop.Gui;
-
-namespace CPPBinding
-{
- public class CPPLanguageBinding : ILanguageBinding
- {
- public const string LanguageName = "C++.NET";
-
- CPPBindingCompilerManager compilerManager = new CPPBindingCompilerManager();
- CPPBindingExecutionManager executionManager = new CPPBindingExecutionManager();
-
- public string Language {
- get {
- return LanguageName;
- }
- }
-
- public void Execute(string filename, bool debug)
- {
- Debug.Assert(executionManager != null);
- executionManager.Execute(filename, debug);
- }
-
- public void Execute(IProject project, bool debug)
- {
- Debug.Assert(executionManager != null);
- executionManager.Execute(project, debug);
- }
-
- public string GetCompiledOutputName(string fileName)
- {
- Debug.Assert(compilerManager != null);
- return compilerManager.GetCompiledOutputName(fileName);
- }
-
- public string GetCompiledOutputName(IProject project)
- {
- Debug.Assert(compilerManager != null);
- return compilerManager.GetCompiledOutputName(project);
- }
-
- public bool CanCompile(string fileName)
- {
- Debug.Assert(compilerManager != null);
- return compilerManager.CanCompile(fileName);
- }
-
- public ICompilerResult CompileFile(string fileName)
- {
- MessageBox.Show("Cannot compile a single file. Create a project first.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
- return null;
- }
-
- public ICompilerResult CompileProject(IProject project)
- {
- return CompileProject(project, false);
- }
-
- public ICompilerResult RecompileProject(IProject project)
- {
- return CompileProject(project, true);
- }
-
- public IProject CreateProject(ProjectCreateInformation info, XmlElement projectOptions)
- {
- return new CPPProject(info, projectOptions);
- }
-
- private ICompilerResult CompileProject(IProject project, bool force)
- {
- Debug.Assert(compilerManager != null);
- return compilerManager.CompileProject(project, force);
- }
- }
-}
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Dependences.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Dependences.cs
deleted file mode 100644
index 834fc36d1d..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Dependences.cs
+++ /dev/null
@@ -1,218 +0,0 @@
-//
-// -*- C# -*-
-//
-// Author: Roman Taranchenko
-// Copyright: (c) 2004 Roman Taranchenko
-// Copying Policy: GNU General Public License
-//
-
-using System;
-using System.Collections;
-using System.IO;
-
-namespace CPPBinding
-{
-
- public interface IDependence
- {
-
- string Name
- {
- get;
- }
-
- DependenceTree DependsOn
- {
- get;
- }
-
- DependenceTree Children
- {
- get;
- }
-
- void Add(IDependence dependence);
-
- DateTime GetLastWriteTime();
-
- bool Exists
- {
- get;
- }
-
- bool Contains(IDependence dep);
-
- bool Contains(string dep);
-
- }
-
- public class SourceFile: IDependence
- {
-
- private string _name;
- private DependenceTree _dependences = new DependenceTree();
-
- public SourceFile(string name)
- {
- _name = name;
- }
-
- public string Name
- {
- get
- {
- return _name;
- }
- }
-
- public DependenceTree Children
- {
- get
- {
- return _dependences;
- }
- }
-
- public DependenceTree DependsOn
- {
- get
- {
- DependenceTree listOfNames = new DependenceTree();
- FillListOfNames(this, listOfNames);
- return listOfNames;
- }
- }
-
- public void Add(IDependence dependence)
- {
- _dependences.Add(dependence);
- }
-
- private static void FillListOfNames(IDependence dependence, DependenceTree list)
- {
- foreach (IDependence dep in dependence.Children)
- {
- list.Add(dep);
- FillListOfNames(dep, list);
- }
- }
-
- public DateTime GetLastWriteTime()
- {
- DateTime result = DateTime.MinValue;
- if (Exists)
- {
- result = File.GetLastWriteTime(_name);
- foreach (IDependence dep in _dependences)
- {
- DateTime dt = dep.GetLastWriteTime();
- if (dt.CompareTo(result) > 0)
- {
- result = dt;
- }
- }
- }
- return result;
- }
-
- public bool Exists
- {
- get
- {
- return File.Exists(_name);
- }
- }
-
- public override string ToString()
- {
- return _name;
- }
-
- public bool Contains(IDependence dep)
- {
- return Contains(dep.Name);
- }
-
- public bool Contains(string dep)
- {
- if (_name.Equals(dep)) {
- return true;
- }
- return _dependences.Contains(dep);
- }
- }
-
- public class DependenceTree: IEnumerable
- {
-
- private SortedList _list;
-
- public DependenceTree()
- {
- _list = new SortedList();
- }
-
- public void Add(IDependence value)
- {
- if (!Contains(value))
- {
- _list.Add(value.Name, value);
- }
- }
-
- public IDependence Get(string name)
- {
- return (IDependence) _list.GetByIndex(_list.IndexOfKey(name));
- }
-
- public IDependence Get(IDependence dep)
- {
- return Get(dep.Name);
- }
-
- public bool Contains(IDependence dep)
- {
- return Contains(dep.Name);
- }
-
- public bool Contains(string name)
- {
- return _list.ContainsKey(name);
- }
-
- public IEnumerator GetEnumerator()
- {
- return new DependenceTreeEnumerator(_list.GetEnumerator());
- }
-
- }
-
- class DependenceTreeEnumerator: IEnumerator
- {
- private IDictionaryEnumerator _enum;
-
- public DependenceTreeEnumerator(IDictionaryEnumerator e)
- {
- _enum = e;
- }
-
- public object Current
- {
- get
- {
- return ((DictionaryEntry)_enum.Current).Value;
- }
- }
-
- public bool MoveNext()
- {
- return _enum.MoveNext();
- }
-
- public void Reset()
- {
- _enum.Reset();
- }
- }
-
-}
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/FormattingStrategy/CPPNetFormattingStrategy.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/FormattingStrategy/CPPNetFormattingStrategy.cs
deleted file mode 100644
index 92d5cced34..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/FormattingStrategy/CPPNetFormattingStrategy.cs
+++ /dev/null
@@ -1,343 +0,0 @@
-//
-//
-//
-//
-//
-//
-
-using System;
-using System.Collections;
-using System.Diagnostics;
-using System.Drawing;
-using System.Text;
-
-using ICSharpCode.TextEditor;
-using ICSharpCode.TextEditor.Document;
-using ICSharpCode.Core;
-
-namespace CPPBinding.FormattingStrategy
-{
- ///
- /// This class handles the auto and smart indenting in the textbuffer while
- /// you type.
- ///
- public class CSharpFormattingStrategy : DefaultFormattingStrategy
- {
- public CSharpFormattingStrategy()
- {
- }
-
- ///
- /// Define CSharp specific smart indenting for a line :)
- ///
- protected override int SmartIndentLine(TextArea textArea, int lineNr)
- {
- if (lineNr > 0) {
- LineSegment lineAbove = textArea.Document.GetLineSegment(lineNr - 1);
- string lineAboveText = lineAbove == null ? "" : textArea.Document.GetText(lineAbove).Trim();
-
- LineSegment curLine = textArea.Document.GetLineSegment(lineNr);
- string curLineText = textArea.Document.GetText(curLine.Offset, curLine.Length).Trim();
-
- if ((lineAboveText.EndsWith(")") && curLineText.StartsWith("{")) || // after for, while, etc.
- (lineAboveText.EndsWith("else") && curLineText.StartsWith("{"))) // after else
- {
- string indentation = GetIndentation(textArea, lineNr - 1);
- textArea.Document.Replace(curLine.Offset, curLine.Length, indentation + curLineText);
- return indentation.Length;
- }
-
- if (curLineText.StartsWith("}")) { // indent closing bracket.
- int closingBracketOffset = TextUtilities.SearchBracketBackward(textArea.Document, curLine.Offset + textArea.Document.GetText(curLine.Offset, curLine.Length).IndexOf('}') - 1, '{', '}');
- if (closingBracketOffset == -1) { // no closing bracket found -> autoindent
- return AutoIndentLine(textArea, lineNr);
- }
-
- string indentation = GetIndentation(textArea, textArea.Document.GetLineNumberForOffset(closingBracketOffset));
-
- textArea.Document.Replace(curLine.Offset, curLine.Length, indentation + curLineText);
- return indentation.Length;
- }
-
- if (lineAboveText.EndsWith(";")) { // expression ended, reset to valid indent.
- int closingBracketOffset = TextUtilities.SearchBracketBackward(textArea.Document, curLine.Offset + textArea.Document.GetText(curLine.Offset, curLine.Length).IndexOf('}') - 1, '{', '}');
-
- if (closingBracketOffset == -1) { // no closing bracket found -> autoindent
- return AutoIndentLine(textArea, lineNr);
- }
-
- int closingBracketLineNr = textArea.Document.GetLineNumberForOffset(closingBracketOffset);
- LineSegment closingBracketLine = textArea.Document.GetLineSegment(closingBracketLineNr);
- string closingBracketLineText = textArea.Document.GetText(closingBracketLine.Offset, closingBracketLine.Length).Trim();
-
- string indentation = GetIndentation(textArea, closingBracketLineNr);
-
- // special handling for switch statement formatting.
- if (closingBracketLineText.StartsWith("switch")) {
- if (lineAboveText.StartsWith("break;") ||
- lineAboveText.StartsWith("goto") ||
- lineAboveText.StartsWith("return")) {
- // nothing
- } else {
- indentation += ICSharpCode.TextEditor.Actions.Tab.GetIndentationString(textArea.Document);
- }
- }
- indentation += ICSharpCode.TextEditor.Actions.Tab.GetIndentationString(textArea.Document);
-
- textArea.Document.Replace(curLine.Offset, curLine.Length, indentation + curLineText);
- return indentation.Length;
- }
-
- if (lineAboveText.EndsWith("{") || // indent opening bracket.
- lineAboveText.EndsWith(":") || // indent case xyz:
- (lineAboveText.EndsWith(")") && // indent single line if, for ... etc
- (lineAboveText.StartsWith("if") ||
- lineAboveText.StartsWith("while") ||
- lineAboveText.StartsWith("for"))) ||
- lineAboveText.EndsWith("else")) {
- string indentation = GetIndentation(textArea, lineNr - 1) + ICSharpCode.TextEditor.Actions.Tab.GetIndentationString(textArea.Document);
- textArea.Document.Replace(curLine.Offset, curLine.Length, indentation + curLineText);
- return indentation.Length;
- } else {
- // try to indent linewrap
- ArrayList bracketPos = new ArrayList();
- for (int i = 0; i < lineAboveText.Length; ++i) { // search for a ( bracket that isn't closed
- switch (lineAboveText[i]) {
- case '(':
- bracketPos.Add(i);
- break;
- case ')':
- if (bracketPos.Count > 0) {
- bracketPos.RemoveAt(bracketPos.Count - 1);
- }
- break;
- }
- }
-
- if (bracketPos.Count > 0) {
- int bracketIndex = (int)bracketPos[bracketPos.Count - 1];
- string indentation = GetIndentation(textArea, lineNr - 1);
-
- for (int i = 0; i <= bracketIndex; ++i) { // insert enough spaces to match
- indentation += " "; // brace start in the next line
- }
-
- textArea.Document.Replace(curLine.Offset, curLine.Length, indentation + curLineText);
- return indentation.Length;
- }
- }
- }
- return AutoIndentLine(textArea, lineNr);
- }
-
- bool NeedCurlyBracket(string text)
- {
- int curlyCounter = 0;
-
- bool inString = false;
- bool inChar = false;
-
- bool lineComment = false;
- bool blockComment = false;
-
- for (int i = 0; i < text.Length; ++i) {
- switch (text[i]) {
- case '\r':
- case '\n':
- lineComment = false;
- break;
- case '/':
- if (blockComment) {
- Debug.Assert(i > 0);
- if (text[i - 1] == '*') {
- blockComment = false;
- }
- }
- if (!inString && !inChar && i + 1 < text.Length) {
- if (!blockComment && text[i + 1] == '/') {
- lineComment = true;
- }
- if (!lineComment && text[i + 1] == '*') {
- blockComment = true;
- }
- }
- break;
- case '"':
- if (!(inChar || lineComment || blockComment)) {
- inString = !inString;
- }
- break;
- case '\'':
- if (!(inString || lineComment || blockComment)) {
- inChar = !inChar;
- }
- break;
- case '{':
- if (!(inString || inChar || lineComment || blockComment)) {
- ++curlyCounter;
- }
- break;
- case '}':
- if (!(inString || inChar || lineComment || blockComment)) {
- --curlyCounter;
- }
- break;
- }
- }
- return curlyCounter > 0;
- }
-
- bool IsInsideStringOrComment(TextArea textArea, LineSegment curLine, int cursorOffset)
- {
- // scan cur line if it is inside a string or single line comment (//)
- bool isInsideString = false;
- bool isInsideComment = false;
- for (int i = curLine.Offset; i < cursorOffset; ++i) {
- char ch = textArea.Document.GetCharAt(i);
- if (ch == '"') {
- isInsideString = !isInsideString;
- }
- if (ch == '/' && i + 1 < cursorOffset && textArea.Document.GetCharAt(i + 1) == '/') {
- isInsideComment = true;
- break;
- }
- }
-
- return isInsideString || isInsideComment;
- }
-
- bool IsInsideDocumentationComment(TextArea textArea, LineSegment curLine, int cursorOffset)
- {
- // scan cur line if it is inside a string or single line comment (//)
- bool isInsideString = false;
- bool isInsideComment = false;
- for (int i = curLine.Offset; i < cursorOffset; ++i) {
- char ch = textArea.Document.GetCharAt(i);
- if (ch == '"') {
- isInsideString = !isInsideString;
- }
- if (!isInsideString) {
- if (ch == '/' && i + 2 < cursorOffset && textArea.Document.GetCharAt(i + 1) == '/' && textArea.Document.GetCharAt(i + 2) == '/') {
- isInsideComment = true;
- break;
- }
- }
- }
-
- return isInsideComment;
- }
-
- public override int FormatLine(TextArea textArea, int lineNr, int cursorOffset, char ch) // used for comment tag formater/inserter
- {
- LineSegment curLine = textArea.Document.GetLineSegment(lineNr);
- LineSegment lineAbove = lineNr > 0 ? textArea.Document.GetLineSegment(lineNr - 1) : null;
-
- //// local string for curLine segment
- string curLineText="";
-
- if (ch != '\n' && ch != '>') {
- if (IsInsideStringOrComment(textArea, curLine, cursorOffset)) {
- return 0;
- }
- }
-
- switch (ch) {
- case '>':
- if (IsInsideDocumentationComment(textArea, curLine, cursorOffset)) {
- curLineText = textArea.Document.GetText(curLine.Offset, curLine.Length);
- int column = textArea.Caret.Offset - curLine.Offset;
- int index = Math.Min(column - 1, curLineText.Length - 1);
-
- while (index >= 0 && curLineText[index] != '<') {
- --index;
- if(curLineText[index] == '/')
- return 0; // the tag was an end tag or already
- }
-
- if (index > 0) {
- StringBuilder commentBuilder = new StringBuilder("");
- for (int i = index; i < curLineText.Length && i < column && !Char.IsWhiteSpace(curLineText[ i]); ++i) {
- commentBuilder.Append(curLineText[ i]);
- }
- string tag = commentBuilder.ToString().Trim();
- if (!tag.EndsWith(">")) {
- tag += ">";
- }
- if (!tag.StartsWith("/")) {
- textArea.Document.Insert(textArea.Caret.Offset, "" + tag.Substring(1));
- }
- }
- }
- break;
- case '}':
- case '{':
- return textArea.Document.FormattingStrategy.IndentLine(textArea, lineNr);
- case '\n':
- if (lineNr <= 0) {
- return IndentLine(textArea, lineNr);
- }
-
- if (textArea.TextEditorProperties.AutoInsertCurlyBracket) {
- string oldLineText = TextUtilities.GetLineAsString(textArea.Document, lineNr - 1);
- if (oldLineText.EndsWith("{")) {
- if (NeedCurlyBracket(textArea.Document.TextContent)) {
- textArea.Document.Insert(curLine.Offset + curLine.Length, "\n}");
- IndentLine(textArea, lineNr + 1);
- }
- }
- }
-
- string lineAboveText = lineAbove == null ? "" : textArea.Document.GetText(lineAbove);
- //// curLine might have some text which should be added to indentation
- curLineText = "";
- if (curLine.Length > 0) {
- curLineText = textArea.Document.GetText(curLine.Offset,curLine.Length);
- }
-
- LineSegment nextLine = lineNr + 1 < textArea.Document.TotalNumberOfLines ? textArea.Document.GetLineSegment(lineNr + 1) : null;
- string nextLineText = lineNr + 1 < textArea.Document.TotalNumberOfLines ? textArea.Document.GetText(nextLine.Offset, nextLine.Length) : "";
-
- if (lineAbove.HighlightSpanStack != null && lineAbove.HighlightSpanStack.Count > 0) {
- if (!((Span)lineAbove.HighlightSpanStack.Peek()).StopEOL) { // case for /* style comments
- int index = lineAboveText == null ? -1 : lineAboveText.IndexOf("/*");
-
- if (index > 0) {
- string indentation = GetIndentation(textArea, lineNr - 1);
- for (int i = indentation.Length; i < index; ++ i) {
- indentation += ' ';
- }
- //// adding curline text
- textArea.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + " * "+curLineText);
- return indentation.Length + 3+curLineText.Length;
- }
-
- index = lineAboveText.IndexOf("*");
- if (index > 0) {
- string indentation = GetIndentation(textArea, lineNr - 1);
- for (int i = indentation.Length; i < index; ++ i) {
- indentation += ' ';
- }
- //// adding curline if present
- textArea.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + "* "+curLineText);
- return indentation.Length + 2 + curLineText.Length;
- }
- } else { // don't handle // lines, because they're only one lined comments
- int indexAbove = lineAboveText.IndexOf("///");
- int indexNext = nextLineText.IndexOf("///");
- if (indexAbove > 0 && (indexNext != -1 || indexAbove + 4 < lineAbove.Length)) {
- string indentation = GetIndentation(textArea, lineNr - 1);
- for (int i = indentation.Length; i < indexAbove; ++ i) {
- indentation += ' ';
- }
- //// adding curline text if present
- textArea.Document.Replace(curLine.Offset, cursorOffset - curLine.Offset, indentation + "/// " + curLineText);
- return indentation.Length + 4 /*+ curLineText.Length*/;
- }
- }
- }
- return IndentLine(textArea, lineNr);
- }
- return 0;
- }
- }
-}
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Gui/CPPCodeGenerationPanel.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Gui/CPPCodeGenerationPanel.cs
deleted file mode 100644
index 6fe9e2ff03..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Gui/CPPCodeGenerationPanel.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-//
-//
-//
-//
-//
-//
-
-using System;
-using System.IO;
-using System.Drawing;
-using System.Windows.Forms;
-
-using ICSharpCode.SharpDevelop.Internal.Project;
-using ICSharpCode.SharpDevelop.Internal.ExternalTool;
-using ICSharpCode.SharpDevelop.Gui;
-using ICSharpCode.Core;
-
-namespace CPPBinding
-{
- public abstract class AbstractCPPConfigPanel : AbstractOptionPanel
- {
- protected CPPCompilerParameters compilerParameters;
- protected System.Windows.Forms.PropertyGrid grid = new System.Windows.Forms.PropertyGrid();
-
- protected abstract void SetGridObject();
-
- public override void LoadPanelContents()
- {
- compilerParameters = (CPPCompilerParameters)((Properties)CustomizationObject).Get("Config");
-
- grid.Dock = DockStyle.Fill;
- SetGridObject();
- Controls.Add(grid);
- }
-
- public override bool StorePanelContents()
- {
- return true;
- }
- }
-
- public class CPPCodeGenerationPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters;
- }
- }
- #region compiler panels
- public class GeneralCPPOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.generalCPPOptions;
- }
- }
- public class OptimizeCPPOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.optimizeCPPOptions;
- }
- }
- public class PreProcessorCPPOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.preProcessorCPPOptions;
- }
- }
-
- public class CodeGenerationCPPOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.codeGenerationCPPOptions;
- }
- }
-
- public class LanguageCPPOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.languageCPPOptions;
- }
- }
-
- public class PreCompiledHeaderCPPOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.preCompiledHeaderCPPOptions;
- }
- }
-
- public class OutputFileCPPOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.outputFileCPPOptions;
- }
- }
-
- public class InformationSearchCPPOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.informationSearchCPPOptions;
- }
- }
-
- public class ExtendedCPPOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.extendedCPPOptions;
- }
- }
- #endregion
-
- public class GeneralLinkerOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.generalLinkerOptions;
- }
- }
- public class InputLinkerOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.inputLinkerOptions;
- }
- }
- public class DebugLinkerOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.debugLinkerOptions;
- }
- }
-
- public class SystemLinkerOptionsPanel : AbstractCPPConfigPanel
- {
- protected override void SetGridObject()
- {
- grid.SelectedObject = this.compilerParameters.systemLinkerOptions;
- }
- }
-
-}
-
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/IncludeParser.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/IncludeParser.cs
deleted file mode 100644
index 0ec1df84d7..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/IncludeParser.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// -*- C# -*-
-//
-// Author: Roman Taranchenko
-// Copyright: (c) 2004 Roman Taranchenko
-// Copying Policy: GNU General Public License
-//
-
-using System;
-using System.Collections;
-using System.IO;
-
-namespace CPPBinding
-{
-
- ///
- /// Description of IncludeParser.
- ///
- public class IncludeParser
- {
- private IDependence _owner;
- private IList _includeDirectories;
- private bool _onlyProjectInclude;
-
- public IncludeParser(IDependence owner, IList includeDirectories, bool onlyProjectInclude)
- {
- _includeDirectories = includeDirectories;
- _owner = owner;
- _onlyProjectInclude = onlyProjectInclude;
- }
-
- public IncludeParser(String fileName, IList includeDirectories, bool onlyProjectInclude)
- {
- _includeDirectories = includeDirectories;
- _owner = new SourceFile(fileName);
- _onlyProjectInclude = onlyProjectInclude;
- }
-
- public IDependence Parse()
- {
- ParseFile(_owner);
- return _owner;
- }
-
- private void ParseFile(IDependence parent)
- {
- if (!parent.Exists)
- {
- return;
- }
- ArrayList includes = new ArrayList();
- StreamReader reader = File.OpenText(parent.Name);
- using (reader)
- {
- string line = null;
- while ((line = reader.ReadLine()) != null)
- {
- line = line.TrimStart(' ', '\t');
- if (line.StartsWith("#include"))
- {
- IDependence include = GetInclude(line);
- if (include != null)
- {
- includes.Add(include);
- }
- }
- }
- }
- foreach (IDependence include in includes)
- {
- parent.Add(include);
- ParseFile(include);
- }
- }
-
- private IDependence GetInclude(string line)
- {
- IDependence result = null;
- int start = -1, end = -1;
- bool quotes = false;
-
- // find first index
- for (int i = 8; i < line.Length; ++i)
- {
- if (!_onlyProjectInclude && line[i] == '<')
- {
- start = i+1;
- break;
- }
- if (line[i] == '"')
- {
- start = i+1;
- quotes = true;
- break;
- }
- }
-
- // find second index
- if (start > 0 && start + 1 < line.Length)
- {
- end = line.IndexOf(quotes ? '"' : '>', start + 1);
- }
-
- // create include
- if (start > 0 && end > start)
- {
- string includeName = line.Substring(start, end-start);
- foreach (string dir in _includeDirectories)
- {
- string fullName = Path.Combine(dir, includeName);
- if (!_owner.Contains(fullName) && File.Exists(fullName))
- {
- result = new SourceFile(fullName);
- }
- }
- }
-
- return result;
- }
-
- }
-
-}
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Project/CPPNetCompilerParameters.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Project/CPPNetCompilerParameters.cs
deleted file mode 100644
index 10b0efb584..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Project/CPPNetCompilerParameters.cs
+++ /dev/null
@@ -1,2257 +0,0 @@
-//
-//
-//
-//
-//
-//
-
-using System;
-using System.ComponentModel;
-using System.Text;
-using System.Xml;
-using System.Diagnostics;
-
-using ICSharpCode.SharpDevelop.Gui;
-using ICSharpCode.SharpDevelop.Internal.Project;
-
-namespace CPPBinding
-{
- #region OPTIMIZATION
- public enum OptimizeLevel {
- Deactivated, // /Od
- MinimizeSize, // /O1
- MaximizeSpeed, // /O2
- CompleteOptimize // /Ox
- }
-
- public enum FloatingPointConsistency {
- Standard,
- Enhanced // /Op
- }
-
- public enum InlineFunctionExpansion
- {
- Standard, // /Ob0
- Manual, // /Ob1
- Automatic // /Ob2
- }
-
- public enum SizeOrSpeedOptimization
- {
- Neither,
- Size,
- Speed
- }
-
- #endregion
-
- #region CODE GENERATION
- public enum Architecture {
- Mixed,
- i386, // /G3
- i486, // /G4
- Pentium, // /G5
- PentiumPRO, // /G6
- Pentium4 // /G7
- }
-
- public enum CallingConvention {
- __cdecl, // default (/Gd)
- __fastcall, // /Gr
- __stdcall // /Gz
- }
-
- public enum EnhancedInstructionSet {
- NotSpecified,
- SSE, // /arch:SSE
- SSE2 // /arch:SSE2
- }
-
- public enum RunTimeObservation {
- Standard,
- Stack, // /RTCs
- UninitializedVariables, // /RTCu
- Both // /RTCs /RTCu
- }
-
- public enum ExceptionHandling {
- None,
- SynchronousExceptionHandling, // /GX
- AsynchronousExceptionHandling // /EHa
- }
-
- public enum StringPooling {
- Disabled,
- Enabled,
- EnabledReadOnlyPooling
- }
-
- #endregion
-
- #region DEBUGGING
- public enum DebugInformationFormat {
- Deactivated,
- C7, // /Z7
- OnlyLineNumbers, // /Zd
- ProgramDatabase, // /Zi
- ProgramDatabaseWithEditAndContinue // /ZI
- }
-
- #endregion
-
- #region PREPROCESSOR
- public enum PreProcessorRun {
- No,
- WithLineNumbers, // /E
- WithoutLineNumbers // /EP
- }
- #endregion
-
- #region LANGUAGE
- public enum StructMemberAlignment {
- Standard,
- Byte1, // /Zp1
- Byte2, // /Zp2
- Byte4, // /Zp4
- Byte8, // /Zp8
- Byte16, // /Zp16
- }
-
- public enum LanguageExtensions {
- Enable, // /Ze
- Disable // /Za
- }
-
- #endregion
-
- #region LINKING
- public enum RunTimeLibrary {
- MultiThreaded, // /MT
- MultiThreadedDebug, // /MTd
- MultiThreadedDLL, // /MD
- MultiThreadedDebugDLL, // /MDd
- SingleThreaded, // /ML
- SingleThreadedDebug // /MLd
- }
-
- public enum ConfigurationType {
- Exe,
- Dll
- }
-
- #endregion
-
- #region PRECOMPILED HEADER
- public enum PreCompiledHeader {
- DontUsePre, // /Y-
- Create, // /Yc
- CreateAutomatically, // /YX
- Use // /Yu
- }
- #endregion
-
- #region MISCELLANEOUS
- public enum CompileType {
- Standard,
- C, // /TC
- CPP // /TP
- }
-
- #endregion
-
-
-
- public enum AssemblyOutput {
- NoList,
- ListAssembly,
- ListAssemblyWithSource,
- ListAssemblyWithCode,
- ListAssemblyWithCodeAndSource,
- }
-
- public enum ShowLinkerStatus {
- Unselected,
- ShowAll,
- ShowSome
- }
- public enum IncrementalLinking {
- Standard,
- Yes,
- No
- }
-
- public enum DebuggableAssembly {
- DontEmitDebuggable,
- EnableDebugToRuntimeDisableOptimization,
- DisableDebugToRuntimEnableOptimization
- }
-
- public enum LinkerSubSystem {
- Unselected,
- Console,
- Windows
- }
- public enum ActivateBigAddresses {
- Standard,
- NoSupport,
- Supported
- }
- public enum TerminalServer {
- Standard,
- NotBound,
- Bound
- }
-
- ///
- /// This class handles project specific compiler parameters
- ///
- public class CPPCompilerParameters : AbstractProjectConfiguration
- {
-
- private static bool IsNotEmpty(string arg)
- {
- return arg != null && arg.Length > 0;
- }
-
- private static void AppendOption(StringBuilder sb, String opt, String val)
- {
- AppendOption(sb, opt, val, true);
- }
-
- private static void AppendOption(StringBuilder sb, String opt, String val, bool quote)
- {
-
- sb.Append(opt);
- if (quote)
- sb.Append('"');
- sb.Append(val);
- if (quote)
- sb.Append('"');
- sb.Append("\n");
- }
-
- private static void AppendList(StringBuilder sb, String opt, String values)
- {
- AppendList(sb, opt, values, true);
- }
-
- private static void AppendList(StringBuilder sb, String opt, String values, bool quote)
- {
- foreach (string val in values.Split(';'))
- {
- AppendOption(sb, opt, val, quote);
- }
- }
-
- #region Misc Options
- [XmlNodeName("MiscOptions")]
- public class MiscCPPOptions
- {
- [ConvertToRelativePath()]
- [XmlAttribute("OutputDirectory")]
- public string outputDirectory = "";
-
- [ConvertToRelativePath()]
- [XmlAttribute("IntermediateDirectory")]
- public string intermediateDirectory = "";
-
- [XmlAttribute("ConfigurationType")]
- public ConfigurationType configurationType = ConfigurationType.Exe;
-
- [XmlAttribute("UseManagedExtensions")]
- public bool useManagedExtensions = true;
-
- [XmlAttribute("additionalCompilerOptions")]
- public string additionalCompilerOptions = "";
- }
- #endregion
-
- #region General Options
- [XmlNodeName("GeneralCPPOptions")]
- public class GeneralCPPOptions
- {
- [XmlAttribute("additionalIncludeDirectories")]
- public string additionalIncludeDirectories = "";
-
- [XmlAttribute("additionalAssemblySearchPaths")]
- public string additionalAssemblySearchPaths = "";
-
- [XmlAttribute("debugInformationFormat")]
- public DebugInformationFormat debugInformationFormat = DebugInformationFormat.Deactivated;
-
- [XmlAttribute("noStartLogo")]
- public bool noStartLogo = true;
-
- [XmlAttribute("warningLevel")]
- public int warningLevel = 4;
-
- [XmlAttribute("search64BitPortabilityProblems")]
- public bool search64BitPortabilityProblems = false;
-
-// [XmlAttribute("treatWarningsAsErrors")]
-// public bool treatWarningsAsErrors = false;
-
- [DefaultValue("")]
- [LocalizedProperty("Additional include paths",
- Description = "Specifies one or more semi-colon delimited additonal paths to search for includes. (/I[path])")]
- public string AdditionalIncludeDirectories {
- get {
- return additionalIncludeDirectories;
- }
- set {
- additionalIncludeDirectories = value;
- }
- }
-
- [DefaultValue("")]
- [LocalizedProperty("Additional assembly search",
- Description = "Specifies one or more semi-colon delimited additonal paths to search for #using assemblies. (/AI[path])")]
- public string AdditionalAssemblySearchPaths {
- get {
- return additionalAssemblySearchPaths;
- }
- set {
- additionalAssemblySearchPaths = value;
- }
- }
-
- [LocalizedProperty("Debug information format",
- Description = "(/Z7, /Zd, /Zi. /ZI)")]
- public DebugInformationFormat DebugInformationFormat {
- get {
- return debugInformationFormat;
- }
- set {
- debugInformationFormat = value;
- }
- }
-
- [DefaultValue(true)]
- [LocalizedProperty("Surpress Startup Logo",
- Description = "Surpress the display of the startup logo and information messages. (/nologo)")]
- public bool NoStartLogo {
- get {
- return noStartLogo;
- }
- set {
- noStartLogo = value;
- }
- }
-
- [DefaultValue(4)]
- [LocalizedProperty("Warning level",
- Description = "(/W0 - /W4)")]
- public int WarningLevel {
- get {
- return warningLevel;
- }
- set {
- warningLevel = value;
- }
- }
-
- [DefaultValue(false)]
- [LocalizedProperty("Search for 64-Bit portability problems",
- Description = "(/Wp64)")]
- public bool Search64BitPortabilityProblems {
- get {
- return search64BitPortabilityProblems;
- }
- set {
- search64BitPortabilityProblems = value;
- }
- }
-
-// [DefaultValue(false)]
-// [LocalizedProperty("Treat warnings as errors",
-// Description = "(/WX)")]
-// public bool TreatWarningsAsErrors {
-// get {
-// return treatWarningsAsErrors;
-// }
-// set {
-// treatWarningsAsErrors = value;
-// }
-// }
-
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
- if (IsNotEmpty(AdditionalIncludeDirectories)) {
- AppendList(result, "/I", AdditionalIncludeDirectories, true);
- }
- if (IsNotEmpty(AdditionalAssemblySearchPaths)) {
- AppendList(result, "/AI", AdditionalAssemblySearchPaths, true);
- }
- switch (DebugInformationFormat) {
- case DebugInformationFormat.Deactivated:
- break;
- case DebugInformationFormat.C7:
- result.Append("/Z7\n");
- break;
- case DebugInformationFormat.OnlyLineNumbers:
- result.Append("/Zd\n");
- break;
- case DebugInformationFormat.ProgramDatabase:
- result.Append("/Zi\n");
- break;
- case DebugInformationFormat.ProgramDatabaseWithEditAndContinue:
- result.Append("/ZI\n");
- break;
-
- }
- if (NoStartLogo) {
- result.Append("/nologo\n");
- }
- AppendOption(result, "/W", WarningLevel.ToString());
- if (Search64BitPortabilityProblems) {
- result.Append("/Wp64\n");
- }
-// if (TreatWarningsAsErrors) {
-// result.Append("/WX\n");
-// }
-
- return result.ToString();
- }
- }
- #endregion
-
- #region Optimize Options
- [XmlNodeName("OptimizeCPPOptions")]
- public class OptimizeCPPOptions
- {
- [XmlAttribute("optimizeLevel")]
- public OptimizeLevel optimizeLevel = OptimizeLevel.Deactivated;
-
- [XmlAttribute("useGlobalOptimize")]
- public bool useGlobalOptimize = false;
-
- [XmlAttribute("inlineFunctionExtension")]
- public InlineFunctionExpansion inlineFunctionExpansion = InlineFunctionExpansion.Standard;
-
- [XmlAttribute("activateSysInternalFunctions")]
- public bool activateSysInternalFunctions = false;
-
- [XmlAttribute("floatingPointConsistency")]
- public FloatingPointConsistency floatingPointConsistency = FloatingPointConsistency.Standard;
-
- [XmlAttribute("sizeOrSpeedOptimization")]
- public SizeOrSpeedOptimization sizeOrSpeedOptimization = SizeOrSpeedOptimization.Neither;
-
- [XmlAttribute("surpressFramePointer")]
- public bool surpressFramePointer = false;
-
- [XmlAttribute("enableFiberSaveOptimize")]
- public bool enableFiberSaveOptimize = false;
-
- [XmlAttribute("architecture")]
- public Architecture architecture = Architecture.Mixed;
-
- [XmlAttribute("optimizeForWindowsExecutable")]
- public bool optimizeForWindowsExecutable = false;
-
- [LocalizedProperty("Optimize Level",
- Description = "/Od,/O1,/O2,/Ox")]
- public OptimizeLevel OptimizeLevel {
- get {
- return optimizeLevel;
- }
- set {
- optimizeLevel = value;
- }
- }
-
- [DefaultValue(false)]
- [LocalizedProperty("Use Global Optimization",
- Description = "/Og")]
- public bool UseGlobalOptimize {
- get {
- return useGlobalOptimize;
- }
- set {
- useGlobalOptimize = value;
- }
- }
- [LocalizedProperty("Inline Functions Expansion",
- Description = "/Ob1,/Ob2")]
- public InlineFunctionExpansion InlineFunctionExpansion {
- get {
- return inlineFunctionExpansion;
- }
- set {
- inlineFunctionExpansion = value;
- }
- }
-// [DefaultValue(false)]
-// [LocalizedProperty("",
-// Description = "")]
-// public bool ActivateSysInternalFunctions {
-// get {
-// return activateSysInternalFunctions;
-// }
-// set {
-// activateSysInternalFunctions = value;
-// }
-// }
- [LocalizedProperty("Floating Point Consistency",
- Description = "/Op")]
- public FloatingPointConsistency FloatingPointConsistency {
- get {
- return floatingPointConsistency;
- }
- set {
- floatingPointConsistency = value;
- }
- }
- [LocalizedProperty("Size Or Speed Optimization",
- Description = "/Ot,/Os")]
- public SizeOrSpeedOptimization SizeOrSpeedOptimization {
- get {
- return sizeOrSpeedOptimization;
- }
- set {
- sizeOrSpeedOptimization = value;
- }
- }
- [DefaultValue(false)]
- [LocalizedProperty("Suppress Frame Pointer",
- Description = "/Oy")]
- public bool SurpressFramePointer {
- get {
- return surpressFramePointer;
- }
- set {
- surpressFramePointer = value;
- }
- }
- [DefaultValue(false)]
- [LocalizedProperty("Fiber Safety Support",
- Description = "/GT")]
- public bool EnableFiberSaveOptimize {
- get {
- return enableFiberSaveOptimize;
- }
- set {
- enableFiberSaveOptimize = value;
- }
- }
- [LocalizedProperty("Optimize for Processor",
- Description = "/G3,/G4,/G5,/G6,/G7")]
- public Architecture Architecture {
- get {
- return architecture;
- }
- set {
- architecture = value;
- }
- }
- [DefaultValue(false)]
- [LocalizedProperty("Optimizes for Windows Application",
- Description = "/GA")]
- public bool OptimizeForWindowsExecutable {
- get {
- return optimizeForWindowsExecutable;
- }
- set {
- optimizeForWindowsExecutable = value;
- }
- }
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
- switch (OptimizeLevel) {
- case OptimizeLevel.CompleteOptimize:
- result.Append("/Ox\n");
- break;
- case OptimizeLevel.Deactivated:
-// result.Append("/Od\n");
- break;
- case OptimizeLevel.MaximizeSpeed:
- result.Append("/O2\n");
- break;
- case OptimizeLevel.MinimizeSize:
- result.Append("/O1\n");
- break;
- }
- switch (FloatingPointConsistency) {
- case FloatingPointConsistency.Enhanced:
- result.Append("/Op\n");
- break;
- }
- switch (architecture) {
- case Architecture.Mixed:
- break;
- case Architecture.i386:
- result.Append("/G3\n");
- break;
- case Architecture.i486:
- result.Append("/G4\n");
- break;
- case Architecture.Pentium:
- result.Append("/G5\n");
- break;
- case Architecture.PentiumPRO:
- result.Append("/G6\n");
- break;
- case Architecture.Pentium4:
- result.Append("/G7\n");
- break;
- }
- if (UseGlobalOptimize) {
- result.Append("/Og\n");
- }
-// if (activateSysInternalFunctions) {
-// result.Append("/\n");
-// }
- if (surpressFramePointer) {
- result.Append("/Oy\n");
- }
- if (enableFiberSaveOptimize) {
- result.Append("/GT\n");
- }
- if (optimizeForWindowsExecutable) {
- result.Append("/GA\n");
- }
- switch (InlineFunctionExpansion) {
- case InlineFunctionExpansion.Automatic:
- result.Append("/Ob2\n");
- break;
- case InlineFunctionExpansion.Manual:
- result.Append("/Ob1\n");
- break;
- case InlineFunctionExpansion.Standard:
- break;
- }
- switch (SizeOrSpeedOptimization) {
- case SizeOrSpeedOptimization.Neither:
- break;
- case SizeOrSpeedOptimization.Size:
- result.Append("/Os\n");
- break;
- case SizeOrSpeedOptimization.Speed:
- result.Append("/Ot\n");
- break;
- }
- return result.ToString();
- }
- }
- #endregion
-
- #region Preprocessor Options
- [XmlNodeName("PreProcessorCPPOptions")]
- public class PreProcessorCPPOptions
- {
- [XmlAttribute("additionalDirectives")]
- public string additionalDirectives = "";
-
- [XmlAttribute("ignoreStandardIncludePath")]
- public bool ignoreStandardIncludePath = false;
-
- [XmlAttribute("preProcessorRun")]
- public PreProcessorRun preProcessorRun = PreProcessorRun.No;
-
- [XmlAttribute("keepComments")]
- public bool keepComments = true;
-
- [LocalizedProperty("Pre Processor Directives",
- Description = "Specifies additional pre processor directives. (/D[macro])")]
- public string AdditionalDirectives {
- get {
- return additionalDirectives;
- }
- set {
- additionalDirectives = value;
- }
- }
-
- [LocalizedProperty("Ignore standard search paths",
- Description = "If true, standard search paths are ignored. (/X)")]
- public bool IgnoreStandardIncludePath {
- get {
- return ignoreStandardIncludePath;
- }
- set {
- ignoreStandardIncludePath = value;
- }
- }
-
- [LocalizedProperty("Pre Processor Run",
- Description = "Specifies the pre processor options for this configuration. (/E, /P, /EP)")]
- public PreProcessorRun PreProcessorRun {
- get {
- return preProcessorRun;
- }
- set {
- preProcessorRun = value;
- }
- }
-
- [LocalizedProperty("Keep comments",
- Description = "Specifies if comments should be removed from the source code. (/C)")]
- public bool KeepComments {
- get {
- return keepComments;
- }
- set {
- keepComments = value;
- }
- }
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
- if (IsNotEmpty(additionalDirectives)) {
- AppendList(result, "/D", additionalDirectives);
- }
- if (ignoreStandardIncludePath) {
- result.Append("/X\n");
- }
- switch (preProcessorRun) {
- case PreProcessorRun.No:
- break;
- case PreProcessorRun.WithLineNumbers:
- result.Append("/P\n");
- if (keepComments) {
- result.Append("/C\n");
- }
- break;
- case PreProcessorRun.WithoutLineNumbers:
- result.Append("/EP\n/P\n");
- if (keepComments) {
- result.Append("/C\n");
- }
- break;
- }
- return result.ToString();
- }
- }
- #endregion
-
- #region Code Generation Options
- [XmlNodeName("CodeGenerationCPPOptions")]
- public class CodeGenerationCPPOptions
- {
- [XmlAttribute("activateStringPooling")]
- public bool activateStringPooling = false;
-
- [XmlAttribute("activateMinimalRecompilation")]
- public bool activateMinimalRecompilation = false;
-
- [XmlAttribute("activateCPPExceptions")]
- public bool activateCPPExceptions = true;
-
- [XmlAttribute("observeSmallTypes")]
- public bool observeSmallTypes = false;
-
- [XmlAttribute("runTimeObservation")]
- public RunTimeObservation runTimeObservation = RunTimeObservation.Standard;
-
- [XmlAttribute("runTimeLibrary")]
- public RunTimeLibrary runTimeLibrary = RunTimeLibrary.MultiThreaded;
-
- [XmlAttribute("structMemberAlignment")]
- public StructMemberAlignment structMemberAlignment = StructMemberAlignment.Standard;
-
- [XmlAttribute("bufferOverflowCheck")]
- public bool bufferOverflowCheck = false;
-
- [XmlAttribute("functionLevelLinking")]
- public bool functionLevelLinking = false;
-
- [XmlAttribute("enhancedInstructionSet")]
- public EnhancedInstructionSet enhancedInstructionSet = EnhancedInstructionSet.NotSpecified;
-
- [LocalizedProperty("Activate String Pooling",
- Description = "(/GF)")]
- public bool ActivateStringPooling {
- get {
- return activateStringPooling;
- }
- set {
- activateStringPooling = value;
- }
- }
-
- [LocalizedProperty("Activate minimal recompilation",
- Description = "(/Gm)")]
- public bool ActivateMinimalRecompilation {
- get {
- return activateMinimalRecompilation;
- }
- set {
- activateMinimalRecompilation = value;
- }
- }
-
- [LocalizedProperty("Activate C++ exceptions",
- Description = "(/EHsc)")]
- public bool ActivateCPPExceptions {
- get {
- return activateCPPExceptions;
- }
- set {
- activateCPPExceptions = value;
- }
- }
-
- [LocalizedProperty("Observe small types",
- Description = "(/RTCc)")]
- public bool ObserveSmallTypes {
- get {
- return observeSmallTypes;
- }
- set {
- observeSmallTypes = value;
- }
- }
-
- [LocalizedProperty("Full Runtimeobservation",
- Description = "(/RTCs, /RTCu, /RTC1)")]
- public RunTimeObservation RunTimeObservation {
- get {
- return runTimeObservation;
- }
- set {
- runTimeObservation = value;
- }
- }
-
- [LocalizedProperty("Runtime library",
- Description = "(/MT, /MTd, /MD, /MDd, /ML, /MLd)")]
- public RunTimeLibrary RunTimeLibrary {
- get {
- return runTimeLibrary;
- }
- set {
- runTimeLibrary = value;
- }
- }
-
- [LocalizedProperty("Struct member alignment",
- Description = "1, 2, 4, 8 or 16 byte. (/Zp[number])")]
- public StructMemberAlignment StructMemberAlignment {
- get {
- return structMemberAlignment;
- }
- set {
- structMemberAlignment = value;
- }
- }
-
- [LocalizedProperty("Buffer overwflow check",
- Description = "(/GS)")]
- public bool BufferOverflowCheck {
- get {
- return bufferOverflowCheck;
- }
- set {
- bufferOverflowCheck = value;
- }
- }
-
- [LocalizedProperty("Activate function level linking",
- Description = "(/Gy)")]
- public bool FunctionLevelLinking {
- get {
- return functionLevelLinking;
- }
- set {
- functionLevelLinking = value;
- }
- }
-
- [LocalizedProperty("Activate enhanced instruction set",
- Description = "(/arch:SSE, /arch:SSE2)")]
- public EnhancedInstructionSet EnhancedInstructionSet {
- get {
- return enhancedInstructionSet;
- }
- set {
- enhancedInstructionSet = value;
- }
- }
-
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
- if (activateStringPooling) {
- result.Append("/GF\n");
- }
- if (activateMinimalRecompilation) {
- result.Append("/Gm\n");
- }
- if (activateCPPExceptions) {
- result.Append("/EHsc\n");
- }
-
- if (observeSmallTypes) {
- result.Append("/RTCc\n");
- }
- switch (runTimeObservation) {
- case RunTimeObservation.Both:
- result.Append("/RTCsu\n");
- break;
- case RunTimeObservation.Stack:
- result.Append("/RTCs\n");
- break;
- case RunTimeObservation.UninitializedVariables:
- result.Append("/RTCu\n");
- break;
- }
- switch (runTimeLibrary) {
- case RunTimeLibrary.MultiThreaded:
- result.Append("/MT\n");
- break;
- case RunTimeLibrary.MultiThreadedDebug:
- result.Append("/MTd\n");
- break;
- case RunTimeLibrary.MultiThreadedDLL:
- result.Append("/MD\n");
- break;
- case RunTimeLibrary.MultiThreadedDebugDLL:
- result.Append("/MDd\n");
- break;
- case RunTimeLibrary.SingleThreaded:
- result.Append("/ML\n");
- break;
- case RunTimeLibrary.SingleThreadedDebug:
- result.Append("/MLd\n");
- break;
- }
-
- switch (structMemberAlignment) {
- case StructMemberAlignment.Standard:
- break;
- case StructMemberAlignment.Byte1:
- result.Append("/Zp1\n");
- break;
- case StructMemberAlignment.Byte2:
- result.Append("/Zp2\n");
- break;
- case StructMemberAlignment.Byte4:
- result.Append("/Zp4\n");
- break;
- case StructMemberAlignment.Byte8:
- result.Append("/Zp8\n");
- break;
- case StructMemberAlignment.Byte16:
- result.Append("/Zp16\n");
- break;
- }
-
- if (bufferOverflowCheck) {
- result.Append("/GS\n");
- }
- if (functionLevelLinking) {
- result.Append("/Gy\n");
- }
-
- switch (EnhancedInstructionSet) {
- case EnhancedInstructionSet.NotSpecified:
- break;
- case EnhancedInstructionSet.SSE:
- result.Append("/arch:SSE\n");
- break;
- case EnhancedInstructionSet.SSE2:
- result.Append("/arch:SSE2\n");
- break;
- }
- return result.ToString();
- }
- }
- #endregion
-
- #region Language Options
- [XmlNodeName("LanguageCPPOptions")]
- public class LanguageCPPOptions
- {
- [XmlAttribute("deactivateLanuageExtensions")]
- public bool deactivateLanuageExtensions = false;
-
- [XmlAttribute("standardCharTypeIsUnsigned")]
- public bool standardCharTypeIsUnsigned = true;
-
- [XmlAttribute("wchar_tIsBuiltIn")]
- public bool wchar_tIsBuiltIn = false;
-
- [XmlAttribute("forceForScope")]
- public bool forceForScope = false;
-
- [XmlAttribute("addRuntimeTypeInformation")]
- public bool addRuntimeTypeInformation = true;
-
- public bool DeactivateLanuageExtensions {
- get {
- return deactivateLanuageExtensions;
- }
- set {
- deactivateLanuageExtensions = value;
- }
- }
- public bool StandardCharTypeIsUnsigned {
- get {
- return standardCharTypeIsUnsigned;
- }
- set {
- standardCharTypeIsUnsigned = value;
- }
- }
- public bool Wchar_tIsBuiltIn {
- get {
- return wchar_tIsBuiltIn;
- }
- set {
- wchar_tIsBuiltIn = value;
- }
- }
- public bool ForceForScope {
- get {
- return forceForScope;
- }
- set {
- forceForScope = value;
- }
- }
- public bool AddRuntimeTypeInformation {
- get {
- return addRuntimeTypeInformation;
- }
- set {
- addRuntimeTypeInformation = value;
- }
- }
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
-
- if (deactivateLanuageExtensions) {
- result.Append("/Za\n");
- }
-
- if (standardCharTypeIsUnsigned) {
- result.Append("/J\n");
- }
-
- if (wchar_tIsBuiltIn) {
- result.Append("/Zc:wchar_t\n");
- }
-
- if (forceForScope) {
- result.Append("/Zc:forScope\n");
- }
-
- if (addRuntimeTypeInformation) {
- result.Append("/GR\n");
- }
-
- return result.ToString();
- }
- }
- #endregion
-
- #region PreCompiler Header Options
- [XmlNodeName("PreCompiledHeaderCPPOptions")]
- public class PreCompiledHeaderCPPOptions
- {
- [XmlAttribute("preCompiledHeader")]
- public PreCompiledHeader preCompiledHeader = PreCompiledHeader.DontUsePre;
-
- [XmlAttribute("headerFile")]
- public string headerFile = "Stdafx.H";
-
- [ConvertToRelativePath()]
- [XmlAttribute("preCompiledHeaderFile")]
- public string preCompiledHeaderFile = "";
-
- public PreCompiledHeader PreCompiledHeader {
- get {
- return preCompiledHeader;
- }
- set {
- preCompiledHeader = value;
- }
- }
- public string HeaderFile {
- get {
- return headerFile;
- }
- set {
- headerFile = value;
- }
- }
- public string PreCompiledHeaderFile
- {
- get
- {
- return preCompiledHeaderFile;
- }
- set
- {
- preCompiledHeaderFile = value;
- }
- }
-
- private void AppendHeaderFile(StringBuilder result)
- {
- if (IsNotEmpty(headerFile)) {
- result.Append("\"");
- result.Append(headerFile);
- result.Append("\"");
- }
- result.Append("\n");
- }
-
- public string GetCreatePreCompiledHeaderParameter()
- {
- StringBuilder result = new StringBuilder();
- result.Append("/Yc");
- AppendHeaderFile(result);
-
- if (IsNotEmpty(preCompiledHeaderFile)) {
- AppendOption(result, "/Fp", preCompiledHeaderFile);
- }
-
- return result.ToString();
- }
-
- public bool PreCompileHeader {
- get {
- return preCompiledHeader == PreCompiledHeader.Create ||
- preCompiledHeader == PreCompiledHeader.Use;
- }
- }
-
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
- switch (preCompiledHeader) {
- case PreCompiledHeader.DontUsePre:
- result.Append("/Y-\n");
- break;
- case PreCompiledHeader.Create:
- case PreCompiledHeader.Use:
- result.Append("/Yu");
- AppendHeaderFile(result);
- break;
- case PreCompiledHeader.CreateAutomatically:
- result.Append("/YX");
- AppendHeaderFile(result);
- break;
-
-// case PreCompiledHeader.Create:
-// result.Append("/Yc");
-// AppendHeaderFile(result);
-// break;
-// case PreCompiledHeader.Use:
-// result.Append("/Yu");
-// AppendHeaderFile(result);
-// break;
-// case PreCompiledHeader.CreateAutomatically:
-// result.Append("/YX");
-// AppendHeaderFile(result);
-// break;
- }
-
- if (IsNotEmpty(preCompiledHeaderFile)) {
- AppendOption(result, "/Fp", preCompiledHeaderFile);
- }
-
- return result.ToString();
- }
- }
- #endregion
-
- #region Output File Options
- [XmlNodeName("OutputFileCPPOptions")]
- public class OutputFileCPPOptions
- {
- [XmlAttribute("extendSourceWithAttributes")]
- public bool extendSourceWithAttributes = false;
-
- [XmlAttribute("assemblyOutput")]
- public AssemblyOutput assemblyOutput = AssemblyOutput.NoList;
-
- [XmlAttribute("assemblerListSaveLocation")]
- public string assemblerListSaveLocation = "";
-
- [XmlAttribute("objectName")]
- public string objectName = "";
-
- [XmlAttribute("programDatabaseName")]
- public string programDatabaseName = "";
-
- public bool ExtendSourceWithAttributes {
- get {
- return extendSourceWithAttributes;
- }
- set {
- extendSourceWithAttributes = value;
- }
- }
- public AssemblyOutput AssemblyOutput {
- get {
- return assemblyOutput;
- }
- set {
- assemblyOutput = value;
- }
- }
- public string AssemblerListSaveLocation {
- get {
- return assemblerListSaveLocation;
- }
- set {
- assemblerListSaveLocation = value;
- }
- }
- public string ObjectName {
- get {
- return objectName;
- }
- set {
- objectName = value;
- }
- }
- public string ProgramDatabaseName {
- get {
- return programDatabaseName;
- }
- set {
- programDatabaseName = value;
- }
- }
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
-
- if (extendSourceWithAttributes) {
- result.Append("/Fx\n");
- }
-
- switch (assemblyOutput) {
- case AssemblyOutput.ListAssembly:
- result.Append("/FA\n");
- break;
- case AssemblyOutput.ListAssemblyWithCode:
- result.Append("/FAc\n");
- break;
- case AssemblyOutput.ListAssemblyWithCodeAndSource:
- result.Append("/FAcs\n");
- break;
- case AssemblyOutput.ListAssemblyWithSource:
- result.Append("/FAs\n");
- break;
- case AssemblyOutput.NoList:
- break;
- }
-
- if (IsNotEmpty(assemblerListSaveLocation))
- {
- AppendOption(result, "/Fa", assemblerListSaveLocation);
- }
-
- if (IsNotEmpty(objectName))
- {
- AppendOption(result, "/Fo", objectName);
- }
-
- if (IsNotEmpty(programDatabaseName))
- {
- AppendOption(result, "/Fd", programDatabaseName);
- }
- return result.ToString();
- }
- }
- #endregion
-
- #region Information Search Options
- [XmlNodeName("InformationSearchCPPOptions")]
- public class InformationSearchCPPOptions
- {
- [XmlAttribute("activateBrowseInformation")]
- public bool activateBrowseInformation = false;
-
- [XmlAttribute("browseFile")]
- public string browseFile = "";
-
- public bool ActivateBrowseInformation {
- get {
- return activateBrowseInformation;
- }
- set {
- activateBrowseInformation = value;
- }
- }
- public string BrowseFile {
- get {
- return browseFile;
- }
- set {
- browseFile = value;
- }
- }
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
- if (activateBrowseInformation) {
- result.Append("/FR");
- if (IsNotEmpty(browseFile))
- {
- result.Append(browseFile);
- }
- result.Append("\n");
- }
- return result.ToString();
- }
- }
- #endregion
-
- #region Extended Options
- [XmlNodeName("ExtendedCPPOptions")]
- public class ExtendedCPPOptions
- {
- [XmlAttribute("callingConvention")]
- public CallingConvention callingConvention = CallingConvention.__cdecl;
-
- [XmlAttribute("compileType")]
- public CompileType compileType = CompileType.CPP;
-
- [XmlAttribute("surpressedWarnings")]
- public string surpressedWarnings = "";
-
- [XmlAttribute("forcedIncludes")]
- public string forcedIncludes = "";
-
- [XmlAttribute("forcedUsings")]
- public string forcedUsings = "";
-
- [XmlAttribute("showIncludes")]
- public bool showIncludes = false;
-
- [XmlAttribute("overridePreProcessorDirectives")]
- public string overridePreProcessorDirectives = "";
-
- [XmlAttribute("overrideAllPreProcessorDirectives")]
- public bool overrideAllPreProcessorDirectives = false;
-
- public CallingConvention CallingConvention {
- get {
- return callingConvention;
- }
- set {
- callingConvention = value;
- }
- }
- public CompileType CompileType {
- get {
- return compileType;
- }
- set {
- compileType = value;
- }
- }
- public string SurpressedWarnings {
- get {
- return surpressedWarnings;
- }
- set {
- surpressedWarnings = value;
- }
- }
- public string ForcedIncludes {
- get {
- return forcedIncludes;
- }
- set {
- forcedIncludes = value;
- }
- }
- public string ForcedUsings {
- get {
- return forcedUsings;
- }
- set {
- forcedUsings = value;
- }
- }
- public bool ShowIncludes {
- get {
- return showIncludes;
- }
- set {
- showIncludes = value;
- }
- }
- public string OverridePreProcessorDirectives {
- get {
- return overridePreProcessorDirectives;
- }
- set {
- overridePreProcessorDirectives = value;
- }
- }
- public bool OverrideAllPreProcessorDirectives {
- get {
- return overrideAllPreProcessorDirectives;
- }
- set {
- overrideAllPreProcessorDirectives = value;
- }
- }
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
- switch (CallingConvention) {
- case CallingConvention.__cdecl:
- result.Append("/Gd\n");
- break;
- case CallingConvention.__fastcall:
- result.Append("/Gr\n");
- break;
- case CallingConvention.__stdcall:
- result.Append("/Gz\n");
- break;
- }
-
- switch (CompileType) {
- case CompileType.C:
- result.Append("/TC\n");
- break;
- case CompileType.CPP:
- result.Append("/TP\n");
- break;
- case CompileType.Standard:
- break;
- }
-
- if (IsNotEmpty(surpressedWarnings))
- {
- AppendList(result, "/wd", surpressedWarnings);
- }
-
- if (IsNotEmpty(forcedIncludes))
- {
- AppendList(result, "/FI", forcedIncludes, true);
- }
-
- if (IsNotEmpty(forcedUsings))
- {
- AppendList(result, "/FU", forcedUsings, true);
- }
-
- if (showIncludes)
- {
- result.Append("/showIncludes\n");
- }
-
- if (overrideAllPreProcessorDirectives)
- {
- result.Append("/u\n");
- }
- else
- {
- if (IsNotEmpty(overridePreProcessorDirectives))
- {
- AppendList(result, "/U", overridePreProcessorDirectives);
- }
- }
-
- return result.ToString();
- }
- }
- #endregion
-
- #region General Linker Options
- [XmlNodeName("GeneralLinkerOptions")]
- public class GeneralLinkerOptions : LocalizedObject
- {
- [XmlAttribute("outputFile")]
- [ConvertToRelativePath()]
- public string outputFile = "a.exe";
-
- [XmlAttribute("showLinkerStatus")]
- public ShowLinkerStatus showLinkerStatus = ShowLinkerStatus.Unselected;
-
- [XmlAttribute("version")]
- public string version = "";
-
- [XmlAttribute("incrementalLinking")]
- public IncrementalLinking incrementalLinking = IncrementalLinking.Standard;
-
- [XmlAttribute("surpressStartLogo")]
- public bool surpressStartLogo = false;
-
- [XmlAttribute("additionalLinkerOptions")]
- public string additionalLinkerOptions = "";
-
-// [XmlAttribute("ignoreImportLibrary")]
-// public bool ignoreImportLibrary = true;
-
-// [XmlAttribute("registerOutput")]
-// public bool registerOutput = false;
-
- [XmlAttribute("additionalLibraryDirectories")]
- public string additionalLibraryDirectories = "";
-
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
-// result.Append("/OUT:");result.Append(outputFile);result.Append("\n");
- switch (ShowLinkerStatus) {
- case ShowLinkerStatus.ShowAll:
- result.Append("/VERBOSE\n");
- break;
- case ShowLinkerStatus.ShowSome:
- result.Append("/VERBOSE:LIB\n");
- break;
-
- }
- if (IsNotEmpty(version)) {
- result.Append("/VERSION:").Append(version).Append("\n");
- }
-
- switch (IncrementalLinking) {
- case IncrementalLinking.Standard:
- break;
- case IncrementalLinking.No:
- result.Append("/INCREMENTAL:NO\n");
- break;
- case IncrementalLinking.Yes:
- result.Append("/INCREMENTAL\n");
- break;
- }
-
- if (SurpressStartLogo) {
- result.Append("/NOLOGO\n");
- }
-
- if (IsNotEmpty(AdditionalLibraryDirectories)) {
- AppendList(result, "/LIBPATH:", AdditionalLibraryDirectories, true);
- }
- result.Append(additionalLinkerOptions);
- result.Append("\n");
- return result.ToString();
- }
-
- [LocalizedProperty("Output File",
- Description = "Specifies the name of the output file. (/OUT:[file])")]
- public string OutputFile {
- get {
- return outputFile;
- }
- set {
- outputFile = value;
- }
- }
-
- [DefaultValue(ShowLinkerStatus.Unselected)]
- [LocalizedProperty("Show Status",
- Description = "Shows detailed progress status. (/VERBOSE, /VERBOSE:LIB)")]
- public ShowLinkerStatus ShowLinkerStatus {
- get {
- return showLinkerStatus;
- }
- set {
- showLinkerStatus = value;
- }
- }
-
- [DefaultValue("")]
- [LocalizedProperty("Version",
- Description = "Use this value as the version number in created image header. (/VERSION:[version])")]
- public string Version {
- get {
- return version;
- }
- set {
- version = value;
- }
- }
-
- [DefaultValue(IncrementalLinking.Standard)]
- [LocalizedProperty("Enable Incremental Linking",
- Description = "Enables incremental linking. (/INCREMENTAL, /INCREMENTAL:NO)")]
- public IncrementalLinking IncrementalLinking {
- get {
- return incrementalLinking;
- }
- set {
- incrementalLinking = value;
- }
- }
-
- [DefaultValue(false)]
- [LocalizedProperty("Surpress Startup Logo",
- Description = "Surpress the display of the startup logo and information messages. (/NOLOGO)")]
- public bool SurpressStartLogo {
- get {
- return surpressStartLogo;
- }
- set {
- surpressStartLogo = value;
- }
- }
-
-// [DefaultValue(true)]
-// [LocalizedProperty("Ignore Import Library",
-// Description = "Specifies that the import library generated by this configuration should not be imported into dependent projects.")]
-// public bool IgnoreImportLibrary {
-// get {
-// return ignoreImportLibrary;
-// }
-// set {
-// ignoreImportLibrary = value;
-// }
-// }
-
-// [LocalizedProperty("Register Output",
-// Description = "Specifies whether to register the primary output of this build.")]
-// public bool RegisterOutput {
-// get {
-// return registerOutput;
-// }
-// set {
-// registerOutput = value;
-// }
-// }
-
- [DefaultValue("")]
- [LocalizedProperty("Additional Library Directories",
- Description = "Specifies one or more semi-colon delimited additonal paths to search for libraries. (/LIBPATH:[path])")]
- public string AdditionalLibraryDirectories {
- get {
- return additionalLibraryDirectories;
- }
- set {
- additionalLibraryDirectories = value;
- }
- }
-
- [DefaultValue("")]
- [LocalizedProperty("Additional Linker Options",
- Description = "Specifies additional options given to the linker.")]
- public string AdditionalLinkerOptions {
- get {
- return additionalLinkerOptions;
- }
- set {
- additionalLinkerOptions = value;
- }
- }
-
-
- }
- #endregion
-
- #region Input Linker Options
- [XmlNodeName("InputLinkerOptions")]
- public class InputLinkerOptions
- {
- [XmlAttribute("additionalDependencies")]
- public string additionalDependencies = "";
-
- [XmlAttribute("ignoreStandardLibrary")]
- public bool ignoreStandardLibrary = false;
-
- [XmlAttribute("ignoreLibrary")]
- public string ignoreLibrary = "";
-
- [XmlAttribute("moduleDefinition")]
- public string moduleDefinition = "";
-
- [XmlAttribute("addModuleToAssembly")]
- public string addModuleToAssembly = "";
-
- [XmlAttribute("embedResourceToAssembly")]
- public string embedResourceToAssembly = "";
-
- [XmlAttribute("forcedSymbolLinks")]
- public string forcedSymbolLinks = "";
-
- [XmlAttribute("laterLoadedDLLs")]
- public string laterLoadedDLLs = "";
-
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
- if (ignoreStandardLibrary)
- {
- result.Append("/NODEFAULTLIB\n");
- }
- else
- {
- if (IsNotEmpty(ignoreLibrary))
- {
- AppendList(result, "/NODEFAULTLIB:", ignoreLibrary);
- }
- }
- if (IsNotEmpty(additionalDependencies))
- {
- AppendList(result, "", additionalDependencies);
- }
- if (IsNotEmpty(moduleDefinition))
- {
- result.Append("/DEF:");
- result.Append(moduleDefinition);
- result.Append("\n");
- }
- if (IsNotEmpty(addModuleToAssembly))
- {
- AppendList(result, "/ASSEMBLYMODULE:", addModuleToAssembly);
- }
- if (IsNotEmpty(embedResourceToAssembly))
- {
- AppendList(result, "/ASSEMBLYRESOURCE:", embedResourceToAssembly);
- }
- if (IsNotEmpty(forcedSymbolLinks))
- {
- AppendList(result, "/INCLUDE:", forcedSymbolLinks);
- }
- if (IsNotEmpty(laterLoadedDLLs))
- {
- AppendList(result, "/DELAYLOAD:", laterLoadedDLLs);
- }
- return result.ToString();
- }
-
- public string AdditionalDependencies {
- get {
- return additionalDependencies;
- }
- set {
- additionalDependencies = value;
- }
- }
-
- public bool IgnoreStandardLibrary {
- get {
- return ignoreStandardLibrary;
- }
- set {
- ignoreStandardLibrary = value;
- }
- }
- public string IgnoreLibrary {
- get {
- return ignoreLibrary;
- }
- set {
- ignoreLibrary = value;
- }
- }
- public string ModuleDefinition {
- get {
- return moduleDefinition;
- }
- set {
- moduleDefinition = value;
- }
- }
- public string AddModuleToAssembly {
- get {
- return addModuleToAssembly;
- }
- set {
- addModuleToAssembly = value;
- }
- }
- public string EmbedResourceToAssembly {
- get {
- return embedResourceToAssembly;
- }
- set {
- embedResourceToAssembly = value;
- }
- }
- public string ForcedSymbolLinks {
- get {
- return forcedSymbolLinks;
- }
- set {
- forcedSymbolLinks = value;
- }
- }
- public string LaterLoadedDLLs {
- get {
- return laterLoadedDLLs;
- }
- set {
- laterLoadedDLLs = value;
- }
- }
-
- }
- #endregion
-
- #region Debug Linker Options
- [XmlNodeName("DebugLinkerOptions")]
- public class DebugLinkerOptions
- {
- [XmlAttribute("generateDebugInfo")]
- public bool generateDebugInfo = false;
-
- [XmlAttribute("generatedProgramDatabase")]
- public string generatedProgramDatabase = "";
-
- [XmlAttribute("removePrivateSymbols")]
- public string removePrivateSymbols = "";
-
- [XmlAttribute("generateMapFile")]
- public bool generateMapFile = false;
-
- [XmlAttribute("mapFile")]
- public string mapFile = "";
-
- [XmlAttribute("mapExport")]
- public bool mapExport = false;
-
- [XmlAttribute("mapLines")]
- public bool mapLines = false;
-
- [XmlAttribute("debuggableAssembly")]
- public DebuggableAssembly debuggableAssembly;
-
- public bool GenerateDebugInfo {
- get {
- return generateDebugInfo;
- }
- set {
- generateDebugInfo = value;
- }
- }
- public string GeneratedProgramDatabase {
- get {
- return generatedProgramDatabase;
- }
- set {
- generatedProgramDatabase = value;
- }
- }
- public string RemovePrivateSymbols {
- get {
- return removePrivateSymbols;
- }
- set {
- removePrivateSymbols = value;
- }
- }
- public bool GenerateMapFile {
- get {
- return generateMapFile;
- }
- set {
- generateMapFile = value;
- }
- }
- public string MapFile {
- get {
- return mapFile;
- }
- set {
- mapFile = value;
- }
- }
- public bool MapExport {
- get {
- return mapExport;
- }
- set {
- mapExport = value;
- }
- }
- public bool MapLines {
- get {
- return mapLines;
- }
- set {
- mapLines = value;
- }
- }
- public DebuggableAssembly DebuggableAssembly {
- get {
- return debuggableAssembly;
- }
- set {
- debuggableAssembly = value;
- }
- }
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
-
- if (generateDebugInfo)
- {
- result.Append("/DEBUG\n");
- }
-
- if (IsNotEmpty(generatedProgramDatabase))
- {
- result.Append("/PDB:");
- result.Append(generatedProgramDatabase);
- result.Append("\n");
- }
-
- if (IsNotEmpty(removePrivateSymbols))
- {
- result.Append("/PDBSTRIPPED:");
- result.Append(removePrivateSymbols);
- result.Append("\n");
- }
-
- if (generateMapFile)
- {
- result.Append("/MAP");
- if (IsNotEmpty(mapFile))
- {
- result.Append(":");
- result.Append(mapFile);
- }
- result.Append("\n");
-
- }
-
- if (mapExport)
- {
- result.Append("/MAPINFO:EXPORTS\n");
- }
-
- if (mapLines)
- {
- result.Append("/MAPINFO:LINES\n");
- }
-
- switch (debuggableAssembly) {
- case DebuggableAssembly.DontEmitDebuggable:
- break;
- case DebuggableAssembly.DisableDebugToRuntimEnableOptimization:
- result.Append("/ASSEMBLYDEBUG:DISABLE\n");
- break;
- case DebuggableAssembly.EnableDebugToRuntimeDisableOptimization:
- result.Append("/ASSEMBLYDEBUG\n");
- break;
- }
-
- return result.ToString();
- }
-
- }
- #endregion
-
- #region System Linker Options
- [XmlNodeName("SystemLinkerOptions")]
- public class SystemLinkerOptions
- {
- [XmlAttribute("linkerSubSystem")]
- public LinkerSubSystem linkerSubSystem = LinkerSubSystem.Unselected;
-
- [XmlAttribute("heapAllocationSize")]
- public int heapAllocationSize = 0;
-
- [XmlAttribute("heapCommitSize")]
- public int heapCommitSize = 0;
-
- [XmlAttribute("stackAllocationSize")]
- public int stackAllocationSize = 0;
-
- [XmlAttribute("stackCommitSize")]
- public int stackCommitSize= 0;
-
- [XmlAttribute("activateBigAddresses")]
- public ActivateBigAddresses activateBigAddresses = ActivateBigAddresses.Standard;
-
- [XmlAttribute("terminalServer")]
- public TerminalServer terminalServer = TerminalServer.Standard;
-
- [XmlAttribute("runFromCDROM")]
- public bool runFromCDROM = false;
-
- [XmlAttribute("runFromNetwork")]
- public bool runFromNetwork = false;
-
- public LinkerSubSystem LinkerSubSystem {
- get {
- return linkerSubSystem;
- }
- set {
- linkerSubSystem = value;
- }
- }
- public int HeapAllocationSize {
- get {
- return heapAllocationSize;
- }
- set {
- heapAllocationSize = value;
- }
- }
- public int HeapCommitSize {
- get {
- return heapCommitSize;
- }
- set {
- heapCommitSize = value;
- }
- }
- public int StackAllocationSize {
- get {
- return stackAllocationSize;
- }
- set {
- stackAllocationSize = value;
- }
- }
- public int StackCommitSize {
- get {
- return stackCommitSize;
- }
- set {
- stackCommitSize = value;
- }
- }
- public ActivateBigAddresses ActivateBigAddresses {
- get {
- return activateBigAddresses;
- }
- set {
- activateBigAddresses = value;
- }
- }
- public TerminalServer TerminalServer {
- get {
- return terminalServer;
- }
- set {
- terminalServer = value;
- }
- }
- public bool RunFromCDROM {
- get {
- return runFromCDROM;
- }
- set {
- runFromCDROM = value;
- }
- }
- public bool RunFromNetwork {
- get {
- return runFromNetwork;
- }
- set {
- runFromNetwork = value;
- }
- }
- public string GetCommandLineParameters()
- {
- StringBuilder result = new StringBuilder();
-
- switch (LinkerSubSystem) {
- case LinkerSubSystem.Console:
- result.Append("/SUBSYSTEM:CONSOLE\n");
- break;
- case LinkerSubSystem.Unselected:
- break;
- case LinkerSubSystem.Windows:
- result.Append("/SUBSYSTEM:WINDOWS\n");
- break;
- }
-
- if (heapAllocationSize > 0)
- {
- result.Append("/HEAP:");
- result.Append(heapAllocationSize);
- if (heapCommitSize > 0)
- {
- result.Append(",");
- result.Append(heapCommitSize);
- }
- result.Append("\n");
- }
-
- if (stackAllocationSize > 0)
- {
- result.Append("/STACK:");
- result.Append(stackAllocationSize);
- if (stackCommitSize > 0)
- {
- result.Append(",");
- result.Append(stackCommitSize);
- }
- result.Append("\n");
- }
-
- switch (ActivateBigAddresses) {
- case ActivateBigAddresses.NoSupport:
- result.Append("/LARGEADDRESSAWARE:NO\n");
- break;
- case ActivateBigAddresses.Standard:
- break;
- case ActivateBigAddresses.Supported:
- result.Append("/LARGEADDRESSAWARE\n");
- break;
- }
-
- switch (TerminalServer) {
- case TerminalServer.Bound:
- result.Append("/TSAWARE\n");
- break;
- case TerminalServer.NotBound:
- result.Append("/TSAWARE:NO\n");
- break;
- case TerminalServer.Standard:
- break;
- }
-
- if (runFromCDROM)
- {
- result.Append("/SWAPRUN:CD\n");
- }
-
- if (runFromNetwork)
- {
- result.Append("/SWAPRUN:NET\n");
- }
-
- return result.ToString();
- }
-
- }
- #endregion
-
-
- public bool PreCompileHeader {
- get {
- return preCompiledHeaderCPPOptions.PreCompileHeader;
- }
- }
-
- public string GetPreCompiledHeaderOptions()
- {
- return generalCPPOptions.GetCommandLineParameters() +
- optimizeCPPOptions.GetCommandLineParameters() +
- preProcessorCPPOptions.GetCommandLineParameters() +
- codeGenerationCPPOptions.GetCommandLineParameters() +
- languageCPPOptions.GetCommandLineParameters() +
- preCompiledHeaderCPPOptions.GetCreatePreCompiledHeaderParameter() +
- outputFileCPPOptions.GetCommandLineParameters() +
- informationSearchCPPOptions.GetCommandLineParameters() +
- extendedCPPOptions.GetCommandLineParameters();
- }
-
- public string GetCompilerOptions()
- {
- return generalCPPOptions.GetCommandLineParameters() +
- optimizeCPPOptions.GetCommandLineParameters() +
- preProcessorCPPOptions.GetCommandLineParameters() +
- codeGenerationCPPOptions.GetCommandLineParameters() +
- languageCPPOptions.GetCommandLineParameters() +
- preCompiledHeaderCPPOptions.GetCommandLineParameters() +
- outputFileCPPOptions.GetCommandLineParameters() +
- informationSearchCPPOptions.GetCommandLineParameters() +
- extendedCPPOptions.GetCommandLineParameters();
- }
-
- public string GetLinkerOptions()
- {
- return generalLinkerOptions.GetCommandLineParameters() +
- inputLinkerOptions.GetCommandLineParameters() +
- debugLinkerOptions.GetCommandLineParameters() +
- systemLinkerOptions.GetCommandLineParameters();
- }
-
- public string GetLinkerOptionsForCompiler()
- {
- StringBuilder result = new StringBuilder();
- foreach (string val in GetLinkerOptions().Split('\n'))
- {
- result.Append(val);
- result.Append("\n");
- }
- return result.ToString();
- }
-
- public GeneralCPPOptions generalCPPOptions = new GeneralCPPOptions();
- public OptimizeCPPOptions optimizeCPPOptions = new OptimizeCPPOptions();
- public PreProcessorCPPOptions preProcessorCPPOptions = new PreProcessorCPPOptions();
- public CodeGenerationCPPOptions codeGenerationCPPOptions = new CodeGenerationCPPOptions();
- public LanguageCPPOptions languageCPPOptions = new LanguageCPPOptions();
- public PreCompiledHeaderCPPOptions preCompiledHeaderCPPOptions = new PreCompiledHeaderCPPOptions();
- public OutputFileCPPOptions outputFileCPPOptions = new OutputFileCPPOptions();
- public InformationSearchCPPOptions informationSearchCPPOptions = new InformationSearchCPPOptions();
- public ExtendedCPPOptions extendedCPPOptions = new ExtendedCPPOptions();
-
- public GeneralLinkerOptions generalLinkerOptions = new GeneralLinkerOptions();
- public InputLinkerOptions inputLinkerOptions = new InputLinkerOptions();
- public DebugLinkerOptions debugLinkerOptions = new DebugLinkerOptions();
- public SystemLinkerOptions systemLinkerOptions = new SystemLinkerOptions();
-
- MiscCPPOptions miscCPPOptions = new MiscCPPOptions();
-
- public override string OutputDirectory {
- get {
- return miscCPPOptions.outputDirectory;
- }
- set {
- miscCPPOptions.outputDirectory = value;
- }
- }
-
- public string OutputFile {
- get {
- return generalLinkerOptions.OutputFile;
- }
- set {
- generalLinkerOptions.OutputFile = value;
- }
- }
-
- public string IntermediateDirectory {
- get {
- return miscCPPOptions.intermediateDirectory;
- }
- set {
- miscCPPOptions.intermediateDirectory = value;
- }
- }
-
- public ConfigurationType ConfigurationType {
- get {
- return miscCPPOptions.configurationType;
- }
- set {
- miscCPPOptions.configurationType = value;
- }
- }
-
- public bool UseManagedExtensions {
- get {
- return miscCPPOptions.useManagedExtensions;
- }
- set {
- miscCPPOptions.useManagedExtensions = value;
- }
- }
-
- public string AdditionalCompilerOptions {
- get {
- return miscCPPOptions.additionalCompilerOptions;
- }
- set {
- miscCPPOptions.additionalCompilerOptions = value;
- }
- }
-
-// public CPPCompilerParameters(string[] additionalCompilerOptions)
-// {
-// this.AdditionalCompilerOptions = additionalCompilerOptions;
-// }
-
- public CPPCompilerParameters()
- {
- }
-
- public CPPCompilerParameters(string name)
- {
- this.name = name;
-
- }
- }
-}
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Project/CPPNetProject.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Project/CPPNetProject.cs
deleted file mode 100644
index 57c47f7f88..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/Project/CPPNetProject.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-//
-//
-//
-//
-//
-//
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Diagnostics;
-using System.ComponentModel;
-using System.Xml;
-
-using ICSharpCode.SharpDevelop.Internal.Project;
-using ICSharpCode.SharpDevelop.Internal.Templates;
-
-namespace CPPBinding
-{
- ///
- /// This class describes a C Sharp project and it compilation options.
- ///
- public class CPPProject : AbstractProject
- {
- public override string ProjectType {
- get {
- return CPPLanguageBinding.LanguageName;
- }
- }
-
- public CPPProject()
- {
- }
-
- public override IConfiguration CreateConfiguration()
- {
- return new CPPCompilerParameters();
- }
-
- public CPPProject(ProjectCreateInformation info, XmlElement projectOptions)
- {
- if (info != null) {
- Name = info.ProjectName;
- Configurations.Add(CreateConfiguration("Debug"));
- Configurations.Add(CreateConfiguration("Release"));
-
- foreach (CPPCompilerParameters parameter in Configurations) {
- parameter.OutputDirectory = info.BinPath + Path.DirectorySeparatorChar + parameter.Name;
- parameter.IntermediateDirectory = info.BinPath + Path.DirectorySeparatorChar + parameter.Name;
- parameter.OutputAssembly = Name;
- if (projectOptions != null) {
- if (projectOptions.Attributes["ConfigurationType"] != null) {
- parameter.ConfigurationType = (ConfigurationType)Enum.Parse(typeof(ConfigurationType), projectOptions.Attributes["ConfigurationType"].InnerText);
- }
- }
- parameter.OutputFile = parameter.OutputDirectory + Path.DirectorySeparatorChar + Name + (parameter.ConfigurationType == ConfigurationType.Dll ? ".dll" : ".exe");
- }
- }
- }
- }
-}
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/CPP.Empty.xft b/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/CPP.Empty.xft
deleted file mode 100644
index 5e5d632d11..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/CPP.Empty.xft
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
- ${res:Templates.File.EmptyFile.Description}
-
-
-
-
-
-
-
-
-
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/CPP.Header.xft b/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/CPP.Header.xft
deleted file mode 100644
index ec93f55ebc..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/CPP.Header.xft
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
- ${res:Templates.File.HeaderFile.Description}
-
-
-
-
-
-
-
-
-
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/ConsoleProject.xpt b/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/ConsoleProject.xpt
deleted file mode 100644
index f5a257de73..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/ConsoleProject.xpt
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
- ${res:Templates.Project.ConsoleProject.Name}
- C++.NET
- C++.Project.DOSProject
- C++.NET
- ${res:Templates.Project.ConsoleProject.Description}
-
-
-
-
-
-
-
-
-
-
- ${ProjectName}
-
-
-
-
-
-
-
-
-
-]]>
-
-
-
-
-
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/EmptyProject.xpt b/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/EmptyProject.xpt
deleted file mode 100644
index ed7a5f87cb..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/EmptyProject.xpt
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
- ${res:Templates.Project.EmptyProject.Name}
- C++.NET
- C++.Project.EmptyProject
- C++.NET
- ${res:Templates.Project.EmptyProject.Description}
-
-
-
-
-
-
diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/FormsProject.xpt b/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/FormsProject.xpt
deleted file mode 100644
index 2ee96da968..0000000000
--- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Templates/FormsProject.xpt
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-
-
-
- ${res:Templates.Project.WindowsApplication.Name}
- C++.NET
- C++.Project.Form
- C++.NET
- ${res:Templates.Project.WindowsApplication.Description}
-
-
-
-
-
-
-
-
-
-
- ${ProjectName}
-
-
-
-
-
- SuspendLayout();
- this->Name = "MainForm";
- this->Text = "This is my form";
- this->Size = System::Drawing::Size(300, 300);
- this->ResumeLayout(false);
-}
-
-int main()
-{
- System::Windows::Forms::Application::Run(new MainForm());
-}]]>
-
-
-#using
-#using
-#using
-]]>
-
-
-
-
-
diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/DocumentAccessor.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/DocumentAccessor.cs
index 3c65346ca3..0e2fd8ef13 100644
--- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/DocumentAccessor.cs
+++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormattingStrategy/DocumentAccessor.cs
@@ -6,7 +6,7 @@
//