public override void CopyFrom(ItemConfiguration configuration) { base.CopyFrom(configuration); var conf = configuration as DProjectConfiguration; if (conf == null) { return; } ObjectDirectory = conf.ObjectDirectory; Output = conf.Output; ExtraCompilerArguments = conf.ExtraCompilerArguments; ExtraLinkerArguments = conf.ExtraLinkerArguments; CompileTarget = conf.CompileTarget; CustomVersionIdentifiers = conf.CustomVersionIdentifiers; CustomDebugIdentifiers = conf.CustomDebugIdentifiers; DebugLevel = conf.DebugLevel; gVersionIds = conf.gVersionIds; //DebugMode = conf.DebugMode; DDocDirectory = conf.DDocDirectory; ExtraLibraries.Clear(); ExtraLibraries.AddRange(conf.ExtraLibraries); if (Changed != null) { Changed(this, new EventArgs()); } }
public override void ResetBuildArguments(DCompileTarget LinkTarget, bool IsDebug) { // Only arguments become reset, not the commands var args = Configuration.GetTargetConfiguration(LinkTarget).GetArguments(IsDebug); var debugAppendix = IsDebug?"-gc -debug":"-O -release"; var noLogoArg = (OS.IsWindows)?"-L/NOLOGO ":""; args.CompilerArguments = "-c \"$src\" -of\"$obj\" $includes " + debugAppendix; args.LinkerArguments = noLogoArg + debugAppendix + " -of\"$target\" $objs $libs"; switch (LinkTarget) { case DCompileTarget.ConsolelessExecutable: //TODO: Complete arg strings which let link to a consoleless executable if (Environment.OSVersion.Platform == PlatformID.MacOSX) { } else if (Environment.OSVersion.Platform == PlatformID.Unix) { } else { args.LinkerArguments += " -L/su:windows -L/exet:nt"; } break; case DCompileTarget.SharedLibrary: args.LinkerArguments += " -L/IMPLIB:$relativeTargetDir "; break; case DCompileTarget.StaticLibrary: args.LinkerArguments = "-lib -of\"$target\" $objs"; break; } }
public override void ResetBuildArguments(DCompileTarget LinkTarget, bool IsDebug) { var args = Configuration.GetTargetConfiguration(LinkTarget).GetArguments(IsDebug); var debugAppendix = IsDebug?"-g": "-O3 -release"; args.CompilerArguments = "-c \"$src\" -of \"$obj\" $includes " + debugAppendix; args.LinkerArguments = "-of \"$target\" " + debugAppendix + " $objs $libs"; switch (LinkTarget) { case DCompileTarget.ConsolelessExecutable: if (Environment.OSVersion.Platform == PlatformID.MacOSX) { } else if (Environment.OSVersion.Platform == PlatformID.Unix) { } else { args.LinkerArguments += " -L/su:windows -L/exet:nt"; } break; case DCompileTarget.SharedLibrary: args.CompilerArguments = "-relocation-model=pic " + args.CompilerArguments; args.LinkerArguments += " -L-shared"; break; case DCompileTarget.StaticLibrary: args.LinkerArguments = "rcs \"$target\" $objs"; break; } }
public void CopyFrom(LinkTargetConfiguration o) { TargetType = o.TargetType; Linker = o.Linker; DebugArguments.CopyFrom(o.DebugArguments); ReleaseArguments.CopyFrom(o.ReleaseArguments); }
public LinkTargetConfiguration GetOrCreateTargetConfiguration (DCompileTarget Target) { LinkTargetConfiguration ltc = null; if (LinkTargetConfigurations.TryGetValue (Target, out ltc)) return ltc; return LinkTargetConfigurations [Target] = new LinkTargetConfiguration { TargetType = Target }; }
public void CopyFrom(LinkTargetConfiguration o) { TargetType = o.TargetType; Compiler = o.Compiler; Linker = o.Linker; ObjectFileLinkPattern = o.ObjectFileLinkPattern; IncludePathPattern = o.IncludePathPattern; DebugArguments.CopyFrom(o.DebugArguments); ReleaseArguments.CopyFrom(o.ReleaseArguments); }
public LinkTargetConfiguration GetOrCreateTargetConfiguration(DCompileTarget Target) { LinkTargetConfiguration ltc = null; if (LinkTargetConfigurations.TryGetValue(Target, out ltc)) { return(ltc); } return(LinkTargetConfigurations [Target] = new LinkTargetConfiguration { TargetType = Target }); }
public void LoadFrom(System.Xml.XmlReader x) { if (x.ReadState == ReadState.Initial) { x.Read(); } if (x.MoveToAttribute("Target")) { TargetType = (DCompileTarget)Enum.Parse(typeof(DCompileTarget), x.ReadContentAsString()); } while (x.Read()) { switch (x.LocalName) { case "CompilerCommand": Compiler = x.ReadString(); break; case "LinkerCommand": Linker = x.ReadString(); break; case "ObjectLinkPattern": ObjectFileLinkPattern = x.ReadString(); break; case "IncludePathPattern": IncludePathPattern = x.ReadString(); break; case "DebugArgs": var s = x.ReadSubtree(); DebugArguments.ReadFrom(s); s.Close(); break; case "ReleaseArgs": var s2 = x.ReadSubtree(); ReleaseArguments.ReadFrom(s2); s2.Close(); break; } } }
public LinkTargetConfiguration GetTargetConfiguration(DCompileTarget Target) { foreach (var t in LinkTargetConfigurations) { if (t.TargetType == Target) { return(t); } } var newTarget = new LinkTargetConfiguration { TargetType = Target }; LinkTargetConfigurations.Add(newTarget); return(newTarget); }
public override void CopyFrom(ItemConfiguration configuration) { base.CopyFrom(configuration); var conf = configuration as DProjectConfiguration; if (conf == null) { return; } ObjectDirectory = conf.ObjectDirectory; Output = conf.Output; ExtraCompilerArguments = conf.ExtraCompilerArguments; ExtraLinkerArguments = conf.ExtraLinkerArguments; CompileTarget = conf.CompileTarget; ExtraLibraries.Clear(); ExtraLibraries.AddRange(conf.ExtraLibraries); if (Changed != null) { Changed(this, new EventArgs()); } }
public DProject(ProjectCreateInformation info, XmlElement projectOptions) { Init(); string binPath = "."; if (info != null) { Name = info.ProjectName; binPath = info.BinPath; } var libs = projectOptions.GetElementsByTagName("Lib"); foreach (XmlNode lib in libs) { if (!string.IsNullOrWhiteSpace(lib.InnerText)) { ExtraLibraries.Add(lib.InnerText); } } // Create a debug configuration var cfg = CreateConfiguration("Debug") as DProjectConfiguration; cfg.DebugMode = true; Configurations.Add(cfg); // Create a release configuration cfg = CreateConfiguration("Release") as DProjectConfiguration; cfg.DebugMode = false; cfg.ExtraCompilerArguments = "-o"; Configurations.Add(cfg); // Prepare all configurations foreach (DProjectConfiguration c in Configurations) { c.OutputDirectory = Path.Combine(binPath, c.Id); c.Output = Name; if (projectOptions != null) { // Set project's target type to the one which has been defined in the project template if (projectOptions.Attributes["Target"] != null) { CompileTarget = (DCompileTarget)Enum.Parse( typeof(DCompileTarget), projectOptions.Attributes["Target"].InnerText); } // Set project's compiler if (projectOptions.Attributes["Compiler"] != null) { UsedCompilerVendor = (DCompilerVendor)Enum.Parse( typeof(DCompilerVendor), projectOptions.Attributes["Compiler"].InnerText); } // Set extra compiler&linker args if (projectOptions.Attributes["CompilerArgs"].InnerText != null) { c.ExtraCompilerArguments = projectOptions.Attributes["CompilerArgs"].InnerText; } if (projectOptions.Attributes["LinkerArgs"].InnerText != null) { c.ExtraLinkerArguments = projectOptions.Attributes["LinkerArgs"].InnerText; } if (projectOptions.GetAttribute("ExternalConsole") == "True") { c.ExternalConsole = true; c.PauseConsoleOutput = true; } if (projectOptions.Attributes["PauseConsoleOutput"] != null) { c.PauseConsoleOutput = bool.Parse( projectOptions.Attributes["PauseConsoleOutput"].InnerText); } } } }
public abstract void ResetBuildArguments(DCompileTarget LinkTarget, bool IsDebug);
public DProject(ProjectCreateInformation info, XmlElement projectOptions) { Init(); string binPath = "."; if (info != null) { Name = info.ProjectName; binPath = info.BinPath; } var libs = projectOptions.GetElementsByTagName("Lib"); foreach (XmlNode lib in libs) if (!string.IsNullOrWhiteSpace(lib.InnerText)) ExtraLibraries.Add(lib.InnerText); // Create a debug configuration var cfg = CreateConfiguration("Debug") as DProjectConfiguration; cfg.DebugMode = true; Configurations.Add(cfg); // Create a release configuration cfg = CreateConfiguration("Release") as DProjectConfiguration; cfg.DebugMode = false; cfg.ExtraCompilerArguments = "-o"; Configurations.Add(cfg); // Prepare all configurations foreach (DProjectConfiguration c in Configurations) { c.OutputDirectory = Path.Combine(binPath, c.Id); c.Output = Name; if (projectOptions != null) { // Set project's target type to the one which has been defined in the project template if (projectOptions.Attributes["Target"] != null) { CompileTarget = (DCompileTarget)Enum.Parse( typeof(DCompileTarget), projectOptions.Attributes["Target"].InnerText); } // Set project's compiler if (projectOptions.Attributes["Compiler"] != null) { UsedCompilerVendor = (DCompilerVendor)Enum.Parse( typeof(DCompilerVendor), projectOptions.Attributes["Compiler"].InnerText); } // Set extra compiler&linker args if (projectOptions.Attributes["CompilerArgs"].InnerText != null) { c.ExtraCompilerArguments = projectOptions.Attributes["CompilerArgs"].InnerText; } if (projectOptions.Attributes["LinkerArgs"].InnerText != null) { c.ExtraLinkerArguments = projectOptions.Attributes["LinkerArgs"].InnerText; } if (projectOptions.GetAttribute("ExternalConsole") == "True") { c.ExternalConsole = true; c.PauseConsoleOutput = true; } if (projectOptions.Attributes["PauseConsoleOutput"] != null) { c.PauseConsoleOutput = bool.Parse( projectOptions.Attributes["PauseConsoleOutput"].InnerText); } } } }
public void LoadFrom(System.Xml.XmlReader x) { if (x.ReadState == ReadState.Initial) x.Read(); if (x.MoveToAttribute("Target")) TargetType = (DCompileTarget)Enum.Parse(typeof(DCompileTarget), x.ReadContentAsString()); while(x.Read()) switch (x.LocalName) { case "CompilerCommand": Compiler = x.ReadString(); break; case "LinkerCommand": Linker = x.ReadString(); break; case "ObjectLinkPattern": ObjectFileLinkPattern = x.ReadString(); break; case "IncludePathPattern": IncludePathPattern = x.ReadString(); break; case "DebugArgs": var s = x.ReadSubtree(); DebugArguments.ReadFrom(s); s.Close(); break; case "ReleaseArgs": var s2 = x.ReadSubtree(); ReleaseArguments.ReadFrom(s2); s2.Close(); break; } }
public override void CopyFrom (ItemConfiguration configuration) { base.CopyFrom (configuration); var conf = configuration as DProjectConfiguration; if (conf == null) return; ObjectDirectory = conf.ObjectDirectory; Output = conf.Output; ExtraCompilerArguments = conf.ExtraCompilerArguments; ExtraLinkerArguments = conf.ExtraLinkerArguments; CompileTarget = conf.CompileTarget; CustomVersionIdentifiers = conf.CustomVersionIdentifiers; CustomDebugIdentifiers = conf.CustomDebugIdentifiers; DebugLevel = conf.DebugLevel; gVersionIds = conf.gVersionIds; UnittestMode = conf.UnittestMode; //DebugMode = conf.DebugMode; DDocDirectory = conf.DDocDirectory; ExtraLibraries.Clear(); ExtraLibraries.AddRange(conf.ExtraLibraries); LinkinThirdPartyLibraries = conf.LinkinThirdPartyLibraries; if (Changed != null) Changed (this, new EventArgs ()); }
public LinkTargetConfiguration GetTargetConfiguration(DCompileTarget Target) { foreach (var t in LinkTargetConfigurations) if (t.TargetType == Target) return t; var newTarget = new LinkTargetConfiguration { TargetType=Target }; LinkTargetConfigurations.Add(newTarget); return newTarget; }
public void Load(DCompilerConfiguration config, bool isDebug) { Configuration = config; IsDebug = isDebug; if (config == null) { Load (null); return; } //compiler targets argsStore [DCompileTarget.Executable] = config .GetOrCreateTargetConfiguration (DCompileTarget.Executable) .GetArguments (isDebug) .Clone (); argsStore [DCompileTarget.SharedLibrary] = config .GetOrCreateTargetConfiguration (DCompileTarget.SharedLibrary) .GetArguments (isDebug) .Clone (); argsStore [DCompileTarget.StaticLibrary] = config .GetOrCreateTargetConfiguration (DCompileTarget.StaticLibrary) .GetArguments (isDebug) .Clone (); SelectedCompileTarget = DCompileTarget.Executable; }
public void CopyFrom (LinkTargetConfiguration o) { TargetType = o.TargetType; Linker = o.Linker; DebugArguments.CopyFrom (o.DebugArguments); ReleaseArguments.CopyFrom (o.ReleaseArguments); }
public override void CopyFrom(ItemConfiguration configuration) { base.CopyFrom (configuration); var conf = configuration as DProjectConfiguration; if (conf == null) return; ObjectDirectory = conf.ObjectDirectory; Output = conf.Output; ExtraCompilerArguments = conf.ExtraCompilerArguments; ExtraLinkerArguments = conf.ExtraLinkerArguments; CompileTarget = conf.CompileTarget; ExtraLibraries.Clear(); ExtraLibraries.AddRange(conf.ExtraLibraries); if (Changed != null) Changed (this, new EventArgs ()); }
public void CopyFrom(LinkTargetConfiguration o) { TargetType = o.TargetType; Compiler = o.Compiler; Linker = o.Linker; ObjectFileLinkPattern = o.ObjectFileLinkPattern; IncludePathPattern = o.IncludePathPattern; DebugArguments.CopyFrom (o.DebugArguments); ReleaseArguments.CopyFrom (o.ReleaseArguments); }