ExceptionHandlerCommandLineProcessor(
      object sender,
      Bam.Core.StringArray commandLineBuilder,
      Bam.Core.Option option,
      Bam.Core.Target target)
 {
 }
Пример #2
0
 VisualStudioProcessor.IConvertToProject.Convert(
     Bam.Core.Module module,
     VSSolutionBuilder.VSSettingsGroup vsSettingsGroup,
     string condition)
 {
     VisualStudioProcessor.Conversion.Convert(typeof(VisualCCommon.VSSolutionImplementation), this, module, vsSettingsGroup, condition);
 }
Пример #3
0
 protected override void Init(
     Bam.Core.Module parent)
 {
     base.Init(parent);
     this.Macros.AddVerbatim("QtPluginDir", "xcbglintegrations");
     this.Macros.AddVerbatim("QtPluginName", "qxcb-glx-integration");
 }
Пример #4
0
        ITarPolicy.CreateTarBall(
            TarBall sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.ICommandLineTool compiler,
            Bam.Core.TokenizedString scriptPath,
            Bam.Core.TokenizedString outputPath)
        {
            var tarPath = outputPath.ToString();
            var tarDir = System.IO.Path.GetDirectoryName(tarPath);
            if (!System.IO.Directory.Exists(tarDir))
            {
                System.IO.Directory.CreateDirectory(tarDir);
            }

            var commandLine = new Bam.Core.StringArray();
            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine);

            commandLine.Add("-c");
            commandLine.Add("-v");
            commandLine.Add("-T");
            commandLine.Add(scriptPath.Parse());
            commandLine.Add("-f");
            commandLine.Add(tarPath);
            CommandLineProcessor.Processor.Execute(context, compiler, commandLine);
        }
        SetDefaultOptionValues(
            Bam.Core.DependencyNode node)
        {
            base.SetDefaultOptionValues(node);

            // TODO: think I can move this to GccCommon, but it misses out the C++ include paths for some reason (see Test9-dev)
            var target = node.Target;
            var gccToolset = target.Toolset as GccCommon.Toolset;
            var machineType = gccToolset.GccDetail.Target;
            var cxxIncludePath = gccToolset.GccDetail.GxxIncludePath;

            if (!System.IO.Directory.Exists(cxxIncludePath))
            {
                throw new Bam.Core.Exception("Gcc C++ include path '{0}' does not exist. Is g++ installed?", cxxIncludePath);
            }
            var cxxIncludePath2 = System.String.Format("{0}/{1}", cxxIncludePath, machineType);
            if (!System.IO.Directory.Exists(cxxIncludePath2))
            {
                throw new Bam.Core.Exception("Gcc C++ include path '{0}' does not exist. Is g++ installed?", cxxIncludePath2);
            }

            var cCompilerOptions = this as C.ICCompilerOptions;
            cCompilerOptions.SystemIncludePaths.Add(cxxIncludePath);
            cCompilerOptions.SystemIncludePaths.Add(cxxIncludePath2);

            GccCommon.CxxCompilerOptionCollection.ExportedDefaults(this, node);
        }
Пример #6
0
        protected override void Init(
            Bam.Core.Module parent)
        {
            base.Init(parent);

            this.Include<CocoaTest>(C.ConsoleApplication.Key, EPublishingType.WindowedApplication);
        }
Пример #7
0
        protected override void Init(
            Bam.Core.Module parent)
        {
            base.Init (parent);

            this.CreateCSourceContainer("$(packagedir)/source/library.c");
        }
Пример #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="fastaEntry">FASTA entry for the chromosome</param>
 /// <param name="chrom">chromosome</param>
 /// <param name="bamFile">path to BAM</param>
 /// <param name="bins">predefined bins</param>
 public BinTask(string fastaFile, string chrom, string bamFile, List <SampleGenomicBin> bins)
 {
     FastaFile  = fastaFile;
     Chromosome = chrom;
     Bam        = new Bam(new FileLocation(bamFile));
     Bins       = bins;
 }
        public static void Convert(
            this C.ICOnlyCompilerSettings settings,
            Bam.Core.Module module,
            XcodeBuilder.Configuration configuration)
        {
            if (settings.LanguageStandard.HasValue)
            {
                switch (settings.LanguageStandard.Value)
                {
                    case C.ELanguageStandard.C89:
                        configuration["GCC_C_LANGUAGE_STANDARD"] = new XcodeBuilder.UniqueConfigurationValue("c89");
                        break;

                    case C.ELanguageStandard.GNU89:
                            configuration["GCC_C_LANGUAGE_STANDARD"] = new XcodeBuilder.UniqueConfigurationValue("gnu89");
                            break;

                    case C.ELanguageStandard.C99:
                        configuration["GCC_C_LANGUAGE_STANDARD"] = new XcodeBuilder.UniqueConfigurationValue("c99");
                        break;

                    case C.ELanguageStandard.GNU99:
                        configuration["GCC_C_LANGUAGE_STANDARD"] = new XcodeBuilder.UniqueConfigurationValue("gnu99");
                        break;

                    default:
                        throw new Bam.Core.Exception("Invalid C language standard, {0}", settings.LanguageStandard.Value.ToString());
                }
            }
        }
Пример #10
0
        void IRccGenerationPolicy.Rcc(
            RccGeneratedSource sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.ICommandLineTool rccCompiler,
            Bam.Core.TokenizedString generatedRccSource,
            QRCFile source)
        {
            var encapsulating = sender.GetEncapsulatingReferencedModule();

            var solution = Bam.Core.Graph.Instance.MetaData as VSSolutionBuilder.VSSolution;
            var project = solution.EnsureProjectExists(encapsulating);
            var config = project.GetConfiguration(encapsulating);

            var output = generatedRccSource.Parse();

            var args = new Bam.Core.StringArray();
            args.Add(CommandLineProcessor.Processor.StringifyTool(rccCompiler));
            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(args);
            args.Add(System.String.Format("-o {0}", output));
            args.Add("%(FullPath)");

            config.AddOtherFile(source);

            var customBuild = config.GetSettingsGroup(VSSolutionBuilder.VSSettingsGroup.ESettingsGroup.CustomBuild, include: source.InputPath, uniqueToProject: true);
            customBuild.AddSetting("Command", args.ToString(' '), condition: config.ConditionText);
            customBuild.AddSetting("Message", System.String.Format("Rccing {0}", System.IO.Path.GetFileName(source.InputPath.Parse())), condition: config.ConditionText);
            customBuild.AddSetting("Outputs", output, condition: config.ConditionText);
        }
Пример #11
0
 public static void Convert(
     System.Type conversionClass,
     Bam.Core.Settings settings,
     Bam.Core.Module module,
     VSSolutionBuilder.VSSettingsGroup vsSettingsGroup,
     string condition)
 {
     var moduleType = typeof(Bam.Core.Module);
     var vsSettingsGroupType = typeof(VSSolutionBuilder.VSSettingsGroup);
     var stringType = typeof(string);
     foreach (var i in settings.Interfaces())
     {
         var method = conversionClass.GetMethod("Convert", new[] { i, moduleType, vsSettingsGroupType, stringType });
         if (null == method)
         {
             throw new Bam.Core.Exception("Unable to locate method {0}.Convert({1}, {2}, {3})",
                 conversionClass.ToString(),
                 i.ToString(),
                 moduleType,
                 vsSettingsGroupType,
                 stringType);
         }
         try
         {
             method.Invoke(null, new object[] { settings, module, vsSettingsGroup, condition });
         }
         catch (System.Reflection.TargetInvocationException exception)
         {
             throw new Bam.Core.Exception(exception.InnerException, "VisualStudio conversion error:");
         }
     }
 }
Пример #12
0
        void IGeneratedSourcePolicy.GenerateSource(
            GeneratedSourceModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.ICommandLineTool compiler,
            Bam.Core.TokenizedString generatedFilePath)
        {
            var encapsulating = sender.GetEncapsulatingReferencedModule();

            var workspace = Bam.Core.Graph.Instance.MetaData as XcodeBuilder.WorkspaceMeta;
            var target = workspace.EnsureTargetExists(encapsulating);
            var configuration = target.GetConfiguration(encapsulating);

            var command = new System.Text.StringBuilder();
            // recode the executable path for Xcode
            var xcodePath = encapsulating.CreateTokenizedString("$(packagebuilddir)/$(config)").Parse();
            xcodePath += "/" + System.IO.Path.GetFileName(compiler.Executable.Parse());
            command.AppendFormat(xcodePath);
            // TODO: change this to a configuration directory really
            command.AppendFormat(" {0}", Bam.Core.TokenizedString.Create("$(buildroot)", null).Parse());
            command.AppendFormat(" {0}", "Generated");

            var commands = new Bam.Core.StringArray();
            commands.Add(command.ToString());
            target.AddPreBuildCommands(commands, configuration);

            var compilerTarget = workspace.EnsureTargetExists(compiler as Bam.Core.Module);
            target.Requires(compilerTarget);
        }
Пример #13
0
        protected override void Init(
            Bam.Core.Module parent)
        {
            base.Init(parent);

            var qtPackage = Bam.Core.Graph.Instance.Packages.First(item => item.Name == "Qt");
            var qtMeta = qtPackage.MetaData as IICUMeta;
            this.Macros.Add("ICUVersion", Bam.Core.TokenizedString.CreateVerbatim(qtMeta.Version));

            this.Macros["MajorVersion"] = this.Macros["ICUVersion"];
            this.Macros["MinorVersion"] = Bam.Core.TokenizedString.CreateVerbatim("1");
            this.Macros.Remove("PatchVersion"); // does not use this part of the version numbering system

            this.Macros.Add("QtInstallPath", Configure.InstallPath);

            if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
            {
                this.Macros.Add("ICUInstallPath", this.CreateTokenizedString("$(QtInstallPath)/bin"));
            }
            else if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Linux))
            {
                this.Macros.Add("ICUInstallPath", this.CreateTokenizedString("$(QtInstallPath)/lib"));
            }

            this.GeneratedPaths[C.DynamicLibrary.Key] = this.CreateTokenizedString("$(ICUInstallPath)/$(dynamicprefix)$(OutputName)$(dynamicext)");
        }
Пример #14
0
        public VSProject EnsureProjectExists(
            Bam.Core.Module module)
        {
            var moduleType = module.GetType();
            lock (this.ProjectMap)
            {
                if (!this.ProjectMap.ContainsKey(moduleType))
                {
                    var project = new VSProject(this, module);
                    this.ProjectMap.Add(moduleType, project);

                    var groups = module.GetType().GetCustomAttributes(typeof(Bam.Core.ModuleGroupAttribute), true);
                    if (groups.Length > 0)
                    {
                        var solutionFolderName = (groups as Bam.Core.ModuleGroupAttribute[])[0].GroupName;
                        this.AddNestedEntity(solutionFolderName, project);
                    }
                }
                if (null == module.MetaData)
                {
                    module.MetaData = this.ProjectMap[moduleType];
                }
                return this.ProjectMap[moduleType];
            }
        }
Пример #15
0
 public Target(
     Bam.Core.TokenizedString nameOrOutput,
     bool isPhony,
     string variableName,
     Bam.Core.Module module,
     int count)
 {
     this.Path = nameOrOutput;
     this.IsPhony = isPhony;
     if (isPhony)
     {
         return;
     }
     if (count > 0)
     {
         return;
     }
     if (Bam.Core.Graph.Instance.IsReferencedModule(module) || !System.String.IsNullOrEmpty(variableName))
     {
         // make the target names unique across configurations
         if (System.String.IsNullOrEmpty(variableName))
         {
             this.VariableName = System.String.Format("{0}_{1}", module.GetType().Name, module.BuildEnvironment.Configuration.ToString());
         }
         else
         {
             this.VariableName = System.String.Format("{0}_{1}", variableName, module.BuildEnvironment.Configuration.ToString());
         }
     }
 }
Пример #16
0
        IObjCopyToolPolicy.ObjCopy(
            ObjCopyModule sender,
            Bam.Core.ExecutionContext context,
            Bam.Core.TokenizedString originalPath,
            Bam.Core.TokenizedString copiedPath)
        {
            var mode = (sender.Settings as IObjCopyToolSettings).Mode;

            // if linking debug data, add to the strip
            var meta = (EObjCopyToolMode.AddGNUDebugLink == mode) ? sender.SourceModule.MetaData as MakeFileBuilder.MakeFileMeta : new MakeFileBuilder.MakeFileMeta(sender);
            var rule = (EObjCopyToolMode.AddGNUDebugLink == mode) ? meta.Rules[0] :meta.AddRule();

            if (EObjCopyToolMode.AddGNUDebugLink == mode)
            {
                rule.AddOrderOnlyDependency(copiedPath.Parse());
            }
            else
            {
                meta.CommonMetaData.Directories.AddUnique(sender.CreateTokenizedString("@dir($(0))", copiedPath).Parse());

                var sourceFilename = System.IO.Path.GetFileName(originalPath.Parse());
                rule.AddTarget(copiedPath, variableName: "objcopy_" + sourceFilename);
                rule.AddPrerequisite(originalPath);
            }

            var commandLine = new Bam.Core.StringArray();
            (sender.Settings as CommandLineProcessor.IConvertToCommandLine).Convert(commandLine);

            rule.AddShellCommand(System.String.Format("{0} {1} {2}",
                CommandLineProcessor.Processor.StringifyTool(sender.Tool as Bam.Core.ICommandLineTool),
                commandLine.ToString(' '),
                CommandLineProcessor.Processor.TerminatingArgs(sender.Tool as Bam.Core.ICommandLineTool)));
        }
        Convert(
            this C.ICommonCompilerSettingsWin settings,
            Bam.Core.StringArray commandLine)
        {
            if (settings.CharacterSet.HasValue)
            {
                switch (settings.CharacterSet.Value)
                {
                    case C.ECharacterSet.NotSet:
                        break;

                    case C.ECharacterSet.Unicode:
                        {
                            var compiler = settings as C.ICommonCompilerSettings;
                            compiler.PreprocessorDefines.Add("_UNICODE");
                        }
                        break;

                    case C.ECharacterSet.MultiByte:
                        {
                            var compiler = settings as C.ICommonCompilerSettings;
                            compiler.PreprocessorDefines.Add("_MBCS");
                        }
                        break;

                    default:
                        throw new Bam.Core.Exception("Unknown character set, {0}", settings.CharacterSet.Value.ToString());
                }
            }
        }
 private static string GetReadGroupSample(Bam bam)
 {
     using (var reader = new BamReader(bam.BamFile))
     {
         return(reader.GetReadGroupSample());
     }
 }
Пример #19
0
        protected override void Init(
            Bam.Core.Module parent)
        {
            base.Init(parent);

            this.CreateSymbolsFrom<Runtime>();
        }
Пример #20
0
 public static void Convert(
     System.Type conversionClass,
     Bam.Core.Settings toolSettings,
     Bam.Core.Module module,
     XcodeBuilder.Configuration configuration)
 {
     var moduleType = typeof(Bam.Core.Module);
     var xcodeConfigurationType = typeof(XcodeBuilder.Configuration);
     foreach (var i in toolSettings.Interfaces())
     {
         var method = conversionClass.GetMethod("Convert", new[] { i, moduleType, xcodeConfigurationType });
         if (null == method)
         {
             throw new Bam.Core.Exception("Unable to locate method {0}.Convert({1}, {2}, {3})",
                 conversionClass.ToString(),
                 i.ToString(),
                 moduleType,
                 xcodeConfigurationType);
         }
         try
         {
             method.Invoke(null, new object[] { toolSettings, module, configuration });
         }
         catch (System.Reflection.TargetInvocationException exception)
         {
             throw new Bam.Core.Exception(exception.InnerException, "Xcode conversion error:");
         }
     }
 }
Пример #21
0
        protected override void Init(
            Bam.Core.Module parent)
        {
            base.Init(parent);

            this.CreateCSourceContainer("$(packagedir)/source/dlldependentapp.c");

            this.PrivatePatch(settings =>
                {
                    var gccLinker = settings as GccCommon.ICommonLinkerSettings;
                    if (gccLinker != null)
                    {
                        gccLinker.CanUseOrigin = true;
                        gccLinker.RPath.AddUnique("$ORIGIN");
                    }
                });

            this.LinkAgainst<MyDynamicLibrary>();

            if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows) &&
                this.Linker is VisualCCommon.LinkerBase)
            {
                this.LinkAgainst<WindowsSDK.WindowsSDK>();
            }
        }
Пример #22
0
        public static void Convert(
            this C.ICommonLinkerSettings settings,
            Bam.Core.StringArray commandLine)
        {
            var module = (settings as Bam.Core.Settings).Module;
            switch (settings.OutputType)
            {
                case C.ELinkerOutput.Executable:
                    commandLine.Add(System.String.Format("-OUT:{0}", module.GeneratedPaths[C.ConsoleApplication.Key].ToString()));
                    break;

                case C.ELinkerOutput.DynamicLibrary:
                    commandLine.Add("-DLL");
                    commandLine.Add(System.String.Format("-OUT:{0}", module.GeneratedPaths[C.ConsoleApplication.Key].ToString()));
                    break;
            }
            foreach (var path in settings.LibraryPaths)
            {
                commandLine.Add(System.String.Format("-LIBPATH:{0}", path.ParseAndQuoteIfNecessary()));
            }
            foreach (var path in settings.Libraries)
            {
                commandLine.Add(path);
            }
            if (settings.DebugSymbols)
            {
                commandLine.Add("-DEBUG");
                if (null != module.GeneratedPaths[C.ConsoleApplication.PDBKey])
                {
                    commandLine.Add(System.String.Format("-PDB:{0}", module.GeneratedPaths[C.ConsoleApplication.PDBKey].Parse()));
                }
            }
        }
Пример #23
0
        GetConfiguration(
            Bam.Core.Module module)
        {
            lock (this.Configurations)
            {
                var moduleConfig = module.BuildEnvironment.Configuration;
                if (this.Configurations.ContainsKey(moduleConfig))
                {
                    return this.Configurations[moduleConfig];
                }

                var platform = Bam.Core.EPlatform.Invalid;
                var bitDepth = (module as C.CModule).BitDepth;
                switch (bitDepth)
                {
                    case C.EBit.ThirtyTwo:
                        platform = Bam.Core.EPlatform.Win32;
                        break;

                    case C.EBit.SixtyFour:
                        platform = Bam.Core.EPlatform.Win64;
                        break;
                }
                if (Bam.Core.EPlatform.Invalid == platform)
                {
                    throw new Bam.Core.Exception("Platform cannot be extracted from the tool {0} for project {1}", module.Tool.ToString(), this.ProjectPath);
                }
                var configuration = new VSProjectConfiguration(this, module, platform);
                this.Configurations.Add(moduleConfig, configuration);
                return configuration;
            }
        }
Пример #24
0
 protected static void SetType(
     Bam.Core.IModule module,
     Bam.Core.Target target)
 {
     var options = module.Options as IOptions;
     options.Target = ETarget.WindowsExecutable;
 }
Пример #25
0
        protected override void Init(
            Bam.Core.Module parent)
        {
            base.Init(parent);

            var source = this.CreateCSourceContainer("$(packagedir)/source/main.c");
            if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows))
            {
                source.AddFile("$(packagedir)/source/win/win.c");
            }
            else if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Linux))
            {
                source.AddFile("$(packagedir)/source/unix/unix.c");
            }
            else if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.OSX))
            {
                source.AddFile("$(packagedir)/source/osx/osx.c");
            }

            if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows) &&
                this.Linker is VisualCCommon.LinkerBase)
            {
                this.LinkAgainst<WindowsSDK.WindowsSDK>();
            }
        }
        Convert(
            this C.ICxxOnlyCompilerSettings settings,
            Bam.Core.StringArray commandLine)
        {
            if (settings.ExceptionHandler.HasValue)
            {
                switch (settings.ExceptionHandler.Value)
                {
                case C.Cxx.EExceptionHandler.Disabled:
                    commandLine.Add("-fno-exceptions");
                    break;

                case C.Cxx.EExceptionHandler.Asynchronous:
                case C.Cxx.EExceptionHandler.Synchronous:
                    commandLine.Add("-fexceptions");
                    break;

                default:
                    throw new Bam.Core.Exception("Unrecognized exception handler option, {0}", settings.ExceptionHandler.Value.ToString());
                }
            }
            if (settings.LanguageStandard.HasValue)
            {
                switch (settings.LanguageStandard.Value)
                {
                    case C.Cxx.ELanguageStandard.Cxx98:
                        commandLine.Add("-std=c++98");
                        break;

                    case C.Cxx.ELanguageStandard.GnuCxx98:
                        commandLine.Add("-std=gnu++98");
                        break;

                    case C.Cxx.ELanguageStandard.Cxx11:
                        commandLine.Add("-std=c++11");
                        break;
                    default:
                        throw new Bam.Core.Exception("Invalid C++ language standard, {0}", settings.LanguageStandard.Value.ToString());
                }
            }
            if (settings.StandardLibrary.HasValue)
            {
                switch (settings.StandardLibrary.Value)
                {
                case C.Cxx.EStandardLibrary.NotSet:
                    break;

                case C.Cxx.EStandardLibrary.libstdcxx:
                    commandLine.Add("-stdlib=libstdc++");
                    break;

                case C.Cxx.EStandardLibrary.libcxx:
                    commandLine.Add("-stdlib=libc++");
                    break;

                default:
                    throw new Bam.Core.Exception("Invalid C++ standard library {0}", settings.StandardLibrary.Value.ToString());
                }
            }
        }
Пример #27
0
        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");
            }
        }
Пример #28
0
 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");
         }
     }
 }
Пример #29
0
        public VSProjectConfiguration(
            VSProject project,
            Bam.Core.Module module,
            Bam.Core.EPlatform platform)
        {
            this.Project = project;
            this.Module = module;
            this.Configuration = module.BuildEnvironment.Configuration;
            this.Platform = platform;
            this.FullName = this.CombinedName;

            this.Type = EType.NA;

            var visualCMeta = Bam.Core.Graph.Instance.PackageMetaData<VisualC.MetaData>("VisualC");
            this.PlatformToolset = visualCMeta.PlatformToolset;
            this.UseDebugLibraries = false;
            this.CharacterSet = C.ECharacterSet.NotSet;
            this.WholeProgramOptimization = false;// TODO: false is consistent with Native builds (module.BuildEnvironment.Configuration != Bam.Core.EConfiguration.Debug);

            this.SettingGroups = new Bam.Core.Array<VSSettingsGroup>();
            this.Sources = new Bam.Core.Array<VSSettingsGroup>();

            this.PreBuildCommands = new Bam.Core.StringArray();
            this.PostBuildCommands = new Bam.Core.StringArray();
        }
Пример #30
0
        public CanvasCallset(
            IFileLocation bam,
            string sampleName,
            IDirectoryLocation wholeGenomeFastaFolder,
            IDirectoryLocation outputFolder,
            IFileLocation kmerFasta,
            IFileLocation filterBed,
            IFileLocation ploidyBed,
            IFileLocation normalVcfPath,
            bool isDbSnpVcf,
            IEnumerable <IFileLocation> normalBamPaths,
            NexteraManifest manifest,
            IFileLocation somaticVcfPath,
            IFileLocation outputVcfPath)
        {
            Bam                    = new Bam(bam);
            SampleName             = sampleName;
            WholeGenomeFastaFolder = wholeGenomeFastaFolder;
            OutputFolder           = outputFolder;
            KmerFasta              = kmerFasta;
            FilterBed              = filterBed;
            PloidyBed              = ploidyBed;
            NormalVcfPath          = normalVcfPath;
            IsDbSnpVcf             = isDbSnpVcf;
            Manifest               = manifest;
            SomaticVcfPath         = somaticVcfPath;
            OutputVcfPath          = outputVcfPath;
            NormalBamPaths         = normalBamPaths.Select(file => new Bam(file));

            var genomeSizeXml = WholeGenomeFastaFolder.GetFileLocation("GenomeSize.xml");

            GenomeMetadata = new GenomeMetadata();
            GenomeMetadata.Deserialize(genomeSizeXml.FullName);
        }
Пример #31
0
        protected override void Init(
            Bam.Core.Module parent)
        {
            base.Init(parent);

            this.PrivatePatch(settings =>
                {
                    var gccCommon = settings as GccCommon.ICommonLinkerSettings;
                    if (null != gccCommon)
                    {
                        gccCommon.CanUseOrigin = true;
                        gccCommon.RPath.AddUnique("$ORIGIN");
                    }
                });

            var source = this.CreateCSourceContainer("$(packagedir)/source/dynamicmain.c");

            this.LinkAgainst<Test4.MyStaticLib>();
            this.CompileAndLinkAgainst<Test4.MyDynamicLib>(source);

            if (this.BuildEnvironment.Platform.Includes(Bam.Core.EPlatform.Windows) &&
                this.Linker is VisualCCommon.LinkerBase)
            {
                this.LinkAgainst<WindowsSDK.WindowsSDK>();
            }
        }
 SystemIncludePathsCommandLineProcessor(
      object sender,
      Bam.Core.StringArray commandLineBuilder,
      Bam.Core.Option option,
      Bam.Core.Target target)
 {
     var optionCollection = sender as C.ICCompilerOptions;
     if (!optionCollection.IgnoreStandardIncludePaths)
     {
         Bam.Core.Log.Full("System include paths not explicitly added to the build");
         return;
     }
     var compilerTool = target.Toolset.Tool(typeof(C.ICompilerTool)) as C.ICompilerTool;
     var switchPrefix = compilerTool.IncludePathCompilerSwitches[0];
     var includePathsOption = option as Bam.Core.ReferenceTypeOption<Bam.Core.DirectoryCollection>;
     foreach (string includePath in includePathsOption.Value)
     {
         if (includePath.Contains(" "))
         {
             commandLineBuilder.Add(System.String.Format("{0}\"{1}\"", switchPrefix, includePath));
         }
         else
         {
             commandLineBuilder.Add(System.String.Format("{0}{1}", switchPrefix, includePath));
         }
     }
 }
Пример #33
0
        Init(
            Bam.Core.Module parent)
        {
            base.Init(parent);

            this.Tool = Bam.Core.Graph.Instance.FindReferencedModule<DSymUtilTool>();
        }
Пример #34
0
 public CanvasTumorNormalWgsInput(Bam tumorBam, Bam normalBam, Vcf normalVcf, Vcf somaticVcf, GenomeMetadata genomeMetadata)
 {
     TumorBam       = tumorBam;
     NormalBam      = normalBam;
     NormalVcf      = normalVcf;
     SomaticVcf     = somaticVcf;
     GenomeMetadata = genomeMetadata;
 }
Пример #35
0
 public SingleSampleCallset(Bam bam, string sampleName, IFileLocation normalVcfPath, bool isDbSnpVcf, IDirectoryLocation analysisOutputFolder, IFileLocation outputVcfPath)
 {
     _analysisOutputFolder = analysisOutputFolder;
     Bam           = bam;
     SampleName    = sampleName;
     NormalVcfPath = normalVcfPath;
     IsDbSnpVcf    = isDbSnpVcf;
     OutputVcfPath = outputVcfPath;
 }
Пример #36
0
 public CanvasTumorNormalWgsInput(Bam tumorBam, Bam normalBam, Vcf normalVcf, Vcf somaticVcf, GenomeMetadata genomeMetadata, SexPloidyInfo sexPloidy)
 {
     TumorBam       = tumorBam;
     NormalBam      = normalBam;
     NormalVcf      = normalVcf;
     SomaticVcf     = somaticVcf;
     GenomeMetadata = genomeMetadata;
     SexPloidy      = sexPloidy;
 }
Пример #37
0
 public CanvasTumorNormalEnrichmentInput(
     Bam tumorBam,
     Bam normalBam,
     Vcf normalVcf,
     Vcf somaticVcf,
     GenomeMetadata genomeMetadata,
     NexteraManifest nexteraManifest)
 {
     TumorBam        = tumorBam;
     NormalBam       = normalBam;
     NormalVcf       = normalVcf;
     SomaticVcf      = somaticVcf;
     GenomeMetadata  = genomeMetadata;
     NexteraManifest = nexteraManifest;
 }
Пример #38
0
 public CanvasEnrichmentInput(Bam bam, GenomeMetadata genomeMetadata,
                              IEnumerable <Bam> controlBamPaths,
                              NexteraManifest nexteraManifest,
                              CanvasEnrichmentPrecomputedControl precomputedControl,
                              SamplePloidyInfo ploidyInfo,
                              IFileLocation predefinedBinsFile,
                              CanvasPcaModels pcaModels)
 {
     Bam                = bam;
     GenomeMetadata     = genomeMetadata;
     NexteraManifest    = nexteraManifest;
     PrecomputedControl = precomputedControl;
     NormalBamPaths     = new ReadOnlyCollection <Bam>(controlBamPaths.ToList());
     PloidyInfo         = ploidyInfo;
     PredefinedBinsFile = predefinedBinsFile;
     PcaModels          = pcaModels;
 }
        public StringBuilder GetSingleSampleCommandLine(string sampleId, Bam bam, GenomeMetadata genomeMetadata, IDirectoryLocation sampleSandbox)
        {
            StringBuilder commandLine = new StringBuilder();

            commandLine.Append($" --bam \"{bam.BamFile}\"");
            commandLine.Append($" --sample-name \"{sampleId}\"");
            IFileLocation kmerFasta = _annotationFileProvider.GetKmerFasta(genomeMetadata);

            commandLine.Append($" --reference \"{kmerFasta}\"");
            IDirectoryLocation wholeGenomeFasta = new FileLocation(genomeMetadata.Sequences.First().FastaPath).Directory;

            commandLine.Append($" --genome-folder \"{wholeGenomeFasta}\"");
            IFileLocation filterBed = _annotationFileProvider.GetFilterBed(genomeMetadata);

            commandLine.Append($" --filter-bed \"{filterBed}\"");
            commandLine.Append($" --output \"{sampleSandbox}\"");

            return(commandLine);
        }
Пример #40
0
 public CanvasPedigreeSample(Bam bam, SampleType sampleType, SexPloidyInfo ploidyInfo)
 {
     Bam        = bam;
     SampleType = sampleType;
     PloidyInfo = ploidyInfo;
 }
Пример #41
0
 public CanvasResequencingInput(Bam bam, Vcf vcf, GenomeMetadata genomeMetadata)
 {
     Bam            = bam;
     GenomeMetadata = genomeMetadata;
     Vcf            = vcf;
 }