本文整理汇总了C#中Bam.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Bam.Add方法的具体用法?C# Bam.Add怎么用?C# Bam.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bam
的用法示例。
在下文中一共展示了Bam.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Convert
Convert(
this ITarBallSettings settings,
Bam.Core.StringArray commandLine)
{
switch (settings.CompressionType)
{
case ETarCompressionType.None:
break;
case ETarCompressionType.gzip:
commandLine.Add("-z");
break;
case ETarCompressionType.bzip:
commandLine.Add("-j");
break;
case ETarCompressionType.lzma:
commandLine.Add("--lzma");
break;
default:
throw new Bam.Core.Exception("Unknown compression type, {0}", settings.CompressionType.ToString());
}
}
示例2: Convert
Convert(
this IObjCopyToolSettings settings,
Bam.Core.StringArray commandLine)
{
var objCopy = (settings as Bam.Core.Settings).Module as ObjCopyModule;
switch (settings.Mode)
{
case EObjCopyToolMode.OnlyKeepDebug:
commandLine.Add(System.String.Format("--only-keep-debug {0} {1}",
objCopy.SourceModule.GeneratedPaths[objCopy.SourceKey].Parse(),
objCopy.GeneratedPaths[ObjCopyModule.Key].Parse()));
break;
case EObjCopyToolMode.AddGNUDebugLink:
commandLine.Add(System.String.Format("--add-gnu-debuglink={0} {1}",
objCopy.GeneratedPaths[ObjCopyModule.Key].Parse(),
objCopy.SourceModule.GeneratedPaths[objCopy.SourceKey].Parse()));
break;
default:
throw new Bam.Core.Exception("Unrecognized objcopy mode, {0}", settings.Mode.ToString());
}
if (settings.Verbose)
{
commandLine.Add("-v");
}
}
示例3: Convert
Convert(
this IDiskImageSettings settings,
Bam.Core.StringArray commandLine)
{
switch (settings.Verbosity)
{
case EDiskImageVerbosity.Default:
break;
case EDiskImageVerbosity.Quiet:
commandLine.Add("-quiet");
break;
case EDiskImageVerbosity.Verbose:
commandLine.Add("-verbose");
break;
case EDiskImageVerbosity.Debug:
commandLine.Add("-debug");
break;
default:
throw new Bam.Core.Exception("Unknown disk image verbosity level, {0}", settings.Verbosity.ToString());
}
// Note: intentionally not parsing ImageSize - used later in the builder scripts
}
示例4: Convert
Convert(
this C.ICxxOnlyCompilerSettings settings,
Bam.Core.StringArray commandLine)
{
if (settings.ExceptionHandler.HasValue)
{
switch (settings.ExceptionHandler.Value)
{
case C.Cxx.EExceptionHandler.Disabled:
// nothing
break;
case C.Cxx.EExceptionHandler.Asynchronous:
commandLine.Add("-EHa");
break;
case C.Cxx.EExceptionHandler.Synchronous:
commandLine.Add("-EHsc");
break;
case C.Cxx.EExceptionHandler.SyncWithCExternFunctions:
commandLine.Add("-EHs");
break;
default:
throw new Bam.Core.Exception("Unrecognized exception handler option, {0}", settings.ExceptionHandler.Value.ToString());
}
}
}
示例5: Convert
public static void Convert(
this C.ICOnlyCompilerSettings settings,
Bam.Core.StringArray commandLine)
{
if (settings.LanguageStandard.HasValue)
{
switch (settings.LanguageStandard.Value)
{
case C.ELanguageStandard.C89:
commandLine.Add("-std=c89");
break;
case C.ELanguageStandard.GNU89:
commandLine.Add("-std=gnu89");
break;
case C.ELanguageStandard.C99:
commandLine.Add("-std=c99");
break;
case C.ELanguageStandard.GNU99:
commandLine.Add("-std=gnu99");
break;
default:
throw new Bam.Core.Exception("Invalid C language standard, '{0}'", settings.LanguageStandard.Value.ToString());
}
}
}
示例6: Convert
Convert(
this IStripToolSettings settings,
Bam.Core.StringArray commandLine)
{
var module = (settings as Bam.Core.Settings).Module;
if (settings.Verbose && !module.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.OSX))
{
commandLine.Add("-v");
}
if (settings.PreserveTimestamp && !module.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.OSX))
{
commandLine.Add("-p");
}
if (settings.StripDebugSymbols)
{
commandLine.Add("-S");
}
if (settings.StripLocalSymbols)
{
commandLine.Add("-x");
}
}
示例7: VisibilityCommandLineProcessor
VisibilityCommandLineProcessor(
object sender,
Bam.Core.StringArray commandLineBuilder,
Bam.Core.Option option,
Bam.Core.Target target)
{
// requires gcc 4.0
var enumOption = option as Bam.Core.ValueTypeOption<EVisibility>;
switch (enumOption.Value)
{
case EVisibility.Default:
commandLineBuilder.Add("-fvisibility=default");
break;
case EVisibility.Hidden:
commandLineBuilder.Add("-fvisibility=hidden");
break;
case EVisibility.Internal:
commandLineBuilder.Add("-fvisibility=internal");
break;
case EVisibility.Protected:
commandLineBuilder.Add("-fvisibility=protected");
break;
default:
throw new Bam.Core.Exception("Unrecognized visibility option");
}
}
示例8: Convert
Convert(
this C.ICommonCompilerSettingsOSX settings,
Bam.Core.StringArray commandLine)
{
foreach (var path in settings.FrameworkSearchPaths)
{
commandLine.Add(System.String.Format("-F{0}", path.ParseAndQuoteIfNecessary()));
}
if (!System.String.IsNullOrEmpty(settings.MinimumVersionSupported))
{
var minVersionRegEx = new System.Text.RegularExpressions.Regex("^(?<Type>[a-z]+)(?<Version>[0-9.]+)$");
var match = minVersionRegEx.Match(settings.MinimumVersionSupported);
if (!match.Groups["Type"].Success)
{
throw new Bam.Core.Exception("Unable to extract SDK type from: '{0}'", settings.MinimumVersionSupported);
}
if (!match.Groups["Version"].Success)
{
throw new Bam.Core.Exception("Unable to extract SDK version from: '{0}'", settings.MinimumVersionSupported);
}
commandLine.Add(System.String.Format("-m{0}-version-min={1}",
match.Groups["Type"].Value,
match.Groups["Version"].Value));
}
}
示例9: Convert
public static void Convert(
this C.ICommonWinResourceCompilerSettings settings,
Bam.Core.StringArray commandLine)
{
if (settings.Verbose.HasValue && settings.Verbose.Value)
{
commandLine.Add("-v");
}
var resource = (settings as Bam.Core.Settings).Module as C.WinResource;
commandLine.Add(System.String.Format("-Fo{0}", resource.GeneratedPaths[C.ObjectFile.Key].ParseAndQuoteIfNecessary()));
}
示例10: Convert
Convert(
this C.ICommonWinResourceCompilerSettings settings,
Bam.Core.StringArray commandLine)
{
if (settings.Verbose.HasValue && settings.Verbose.Value)
{
commandLine.Add("-v");
}
var resource = (settings as Bam.Core.Settings).Module as C.WinResource;
commandLine.Add("--use-temp-file"); // avoiding a popen error, see https://amindlost.wordpress.com/2012/06/09/mingw-windres-exe-cant-popen-error/
commandLine.Add(System.String.Format("-o {0}", resource.GeneratedPaths[C.ObjectFile.Key].ParseAndQuoteIfNecessary()));
}
示例11: Convert
Convert(
this GccCommon.ICommonCompilerSettings settings,
Bam.Core.StringArray commandLine)
{
if (settings.PositionIndependentCode.HasValue)
{
if (settings.PositionIndependentCode.Value)
{
commandLine.Add("-fPIC");
}
}
if (settings.AllWarnings.HasValue)
{
if (settings.AllWarnings.Value)
{
commandLine.Add("-Wall");
}
}
if (settings.ExtraWarnings.HasValue)
{
if (settings.ExtraWarnings.Value)
{
commandLine.Add("-Wextra");
}
}
if (settings.Pedantic.HasValue)
{
if (settings.Pedantic.Value)
{
commandLine.Add("-pedantic");
}
}
if (settings.Visibility.HasValue)
{
switch (settings.Visibility.Value)
{
case EVisibility.Default:
commandLine.Add("-fvisibility=default");
break;
case EVisibility.Hidden:
commandLine.Add("-fvisibility=hidden");
break;
case EVisibility.Internal:
commandLine.Add("-fvisibility=internal");
break;
case EVisibility.Protected:
commandLine.Add("-fvisibility=protected");
break;
default:
throw new Bam.Core.Exception("Unrecognized visibility, {0}", settings.Visibility.Value.ToString());
}
}
if (settings.StrictAliasing.HasValue)
{
if (settings.StrictAliasing.Value)
{
commandLine.Add("-fstrict-aliasing");
}
}
}
示例12: Convert
Convert(
this C.ICommonLinkerSettings settings,
Bam.Core.StringArray commandLine)
{
var module = (settings as Bam.Core.Settings).Module;
switch (settings.Bits)
{
case C.EBit.SixtyFour:
commandLine.Add("-arch x86_64");
break;
case C.EBit.ThirtyTwo:
commandLine.Add("-arch i386");
break;
default:
throw new Bam.Core.Exception("Unknown bit depth, {0}", settings.Bits.ToString());
}
switch (settings.OutputType)
{
case C.ELinkerOutput.Executable:
commandLine.Add(System.String.Format("-o {0}", module.GeneratedPaths[C.ConsoleApplication.Key].ToString()));
break;
case C.ELinkerOutput.DynamicLibrary:
{
commandLine.Add("-dynamiclib");
commandLine.Add(System.String.Format("-o {0}", module.GeneratedPaths[C.ConsoleApplication.Key].ToString()));
var versionString = module.CreateTokenizedString("$(MajorVersion).$(MinorVersion)#valid(.$(PatchVersion))").Parse();
commandLine.Add(System.String.Format("-current_version {0}", versionString));
// TODO: offer an option of setting the compatibility version differently
commandLine.Add(System.String.Format("-compatibility_version {0}", versionString));
}
break;
}
foreach (var path in settings.LibraryPaths)
{
commandLine.Add(System.String.Format("-L{0}", path.ParseAndQuoteIfNecessary()));
}
foreach (var path in settings.Libraries)
{
commandLine.Add(path);
}
if (settings.DebugSymbols)
{
commandLine.Add("-g");
}
}
示例13: Convert
Convert(
this IInstallNameToolSettings settings,
Bam.Core.StringArray commandLine)
{
switch (settings.Mode)
{
case EInstallNameToolMode.UpdateIDName:
commandLine.Add("-id");
break;
case EInstallNameToolMode.ChangeIDName:
commandLine.Add("-change");
break;
}
}
示例14: CheckedCommandLineProcessor
private static void CheckedCommandLineProcessor(
object sender,
Bam.Core.StringArray commandLineBuilder,
Bam.Core.Option option,
Bam.Core.Target target)
{
var boolOption = option as Bam.Core.ValueTypeOption<bool>;
if (boolOption.Value)
{
commandLineBuilder.Add("/checked+");
}
else
{
commandLineBuilder.Add("/checked-");
}
}
示例15: Convert
Convert(
this GccCommon.ICommonLinkerSettings settings,
Bam.Core.StringArray commandLine)
{
if (settings.CanUseOrigin)
{
commandLine.Add("-Wl,-z,origin");
}
foreach (var rpath in settings.RPath)
{
commandLine.Add(System.String.Format("-Wl,-rpath,{0}", rpath));
}
foreach (var rpath in settings.RPathLink)
{
commandLine.Add(System.String.Format("-Wl,-rpath-link,{0}", rpath));
}
}