public RegisterWinResourceCompilerAttribute(
     string toolsetName,
     Bam.Core.EPlatform platform,
     EBit bitDepth)
     :
     base(toolsetName, platform, bitDepth)
 {}
Example #2
0
 public RegisterCxxLinkerAttribute(
     string toolsetName,
     Bam.Core.EPlatform platform,
     EBit bitDepth)
     :
     base(toolsetName, platform, bitDepth)
 {
 }
 public RegisterWinResourceCompilerAttribute(
     string toolsetName,
     Bam.Core.EPlatform platform,
     EBit bitDepth)
     :
     base(toolsetName, platform, bitDepth)
 {
 }
 public RegisterLibrarianAttribute(
     string toolsetName,
     Bam.Core.EPlatform platform,
     EBit bitDepth)
     :
     base(toolsetName, platform, bitDepth)
 {
 }
Example #5
0
 public RegisterObjectiveCCompilerAttribute(
     string toolsetName,
     Bam.Core.EPlatform platform,
     EBit bitDepth)
     :
     base(toolsetName, platform, bitDepth)
 {
 }
 public RegisterLibrarianAttribute(
     string toolsetName,
     Bam.Core.EPlatform platform,
     EBit bitDepth)
     :
     base(toolsetName, platform, bitDepth)
 {
 }
 public RegisterObjectiveCxxCompilerAttribute(
     string toolsetName,
     Bam.Core.EPlatform platform,
     EBit bitDepth)
     :
     base(toolsetName, platform, bitDepth)
 {
 }
Example #8
0
 protected ToolRegistrationAttribute(
     string toolsetName,
     Bam.Core.EPlatform platform,
     EBit bitDepth)
 {
     this.ToolsetName = toolsetName;
     this.Platform    = platform;
     this.BitDepth    = bitDepth;
 }
Example #9
0
        GetTool <ToolType>(
            System.Collections.Generic.Dictionary <EBit, Bam.Core.TypeArray> collection,
            EBit bitDepth,
            string toolDescription)
            where ToolType : Bam.Core.PreBuiltTool
        {
            if (!collection.ContainsKey(bitDepth) || 0 == collection[bitDepth].Count)
            {
                throw new Bam.Core.Exception("No default {0}s found for this platform in {1}-bits. Are all relevant packages present?", toolDescription, (int)bitDepth);
            }
            var candidates = collection[bitDepth];

            if (candidates.Count > 1)
            {
                if (null != UserToolchainOverride)
                {
                    foreach (var toolType in candidates)
                    {
                        var attr = toolType.GetCustomAttributes(false);
                        if ((attr[0] as ToolRegistrationAttribute).ToolsetName == UserToolchainOverride)
                        {
                            return(Bam.Core.Graph.Instance.MakeModuleOfType <ToolType>(toolType));
                        }
                    }
                }

                var tooManyInstance = new System.Text.StringBuilder();
                tooManyInstance.AppendFormat("There are {0} {1}s available for this platform in {2}-bits. Resolve using the command line option {3}=<choice>",
                                             candidates.Count,
                                             toolDescription,
                                             (int)bitDepth,
                                             (SelectDefaultToolChainCommand as Bam.Core.ICommandLineArgument).LongName);
                tooManyInstance.AppendLine();
                foreach (var tool in candidates)
                {
                    tooManyInstance.AppendFormat("\t{0}", tool.ToString());
                    tooManyInstance.AppendLine();
                }
                throw new Bam.Core.Exception(tooManyInstance.ToString());
            }
            var toolTypeToUse = candidates[0];
            var toolToolSet   = (toolTypeToUse.GetCustomAttributes(false)[0] as ToolRegistrationAttribute).ToolsetName;

            if ((null != UserToolchainOverride) && (toolToolSet != UserToolchainOverride))
            {
                var wrongToolchain = new System.Text.StringBuilder();
                wrongToolchain.AppendFormat("{0}-bit {1} identified is from the {2} toolchain, not {3} as requested. Resolve using the command line option {4}={2}",
                                            (int)bitDepth,
                                            toolDescription,
                                            toolToolSet,
                                            UserToolchainOverride,
                                            (SelectDefaultToolChainCommand as Bam.Core.ICommandLineArgument).LongName);
                wrongToolchain.AppendLine();
                throw new Bam.Core.Exception(wrongToolchain.ToString());
            }
            return(Bam.Core.Graph.Instance.MakeModuleOfType <ToolType>(toolTypeToUse));
        }
 protected ToolRegistrationAttribute(
     string toolsetName,
     Bam.Core.EPlatform platform,
     EBit bitDepth)
 {
     this.ToolsetName = toolsetName;
     this.Platform = platform;
     this.BitDepth = bitDepth;
 }
        GetTool <ToolType>(
            System.Collections.Generic.Dictionary <EBit, Bam.Core.TypeArray> collection,
            EBit bitDepth,
            string toolDescription,
            ref ToolType toolModule)
            where ToolType : Bam.Core.PreBuiltTool
        {
            if (null != toolModule)
            {
                return(toolModule);
            }
            if (!DisambiguousToolchainToUse.ContainsKey(bitDepth))
            {
                var candidates      = collection[bitDepth];
                var tooManyInstance = new System.Text.StringBuilder();
                tooManyInstance.AppendFormat("There are {0} {1}s available for this platform in {2}-bits. Resolve using the command line option {3}=<choice>",
                                             candidates.Count,
                                             toolDescription,
                                             (int)bitDepth,
                                             (SelectDefaultToolChainCommand as Bam.Core.ICommandLineArgument).LongName);
                tooManyInstance.AppendLine();
                foreach (var tool in candidates)
                {
                    tooManyInstance.AppendFormat("\t{0}", tool.ToString());
                    tooManyInstance.AppendLine();
                }
                throw new Bam.Core.Exception(tooManyInstance.ToString());
            }
            var toolchainToUse = DisambiguousToolchainToUse[bitDepth];

            if (null == toolchainToUse)
            {
                throw new Bam.Core.Exception("{0} tool is undefined in {1}-bit architectures", toolDescription, bitDepth.ToString());
            }
            var toolTypeCollection    = collection[bitDepth];
            var toolTypeToInstantiate = toolTypeCollection.FirstOrDefault(item => (item.GetCustomAttributes(false)[0] as ToolRegistrationAttribute).ToolsetName == toolchainToUse);

            if (null == toolTypeToInstantiate)
            {
                throw new Bam.Core.Exception("Unable to identify {0} tool in {1}-bit architectures for toolchain {2}", toolDescription, bitDepth.ToString(), toolchainToUse);
            }
            toolModule = Bam.Core.Graph.Instance.MakeModuleOfType <ToolType>(toolTypeToInstantiate);
            return(toolModule);
        }
Example #12
0
 Cxx_Compiler(
     EBit bitDepth)
 {
     return(GetTool <CompilerTool>(Cxx_Compilers, bitDepth, "C++ compiler"));
 }
 Cxx_Compiler(
     EBit bitDepth)
 {
     return(GetTool <CompilerTool>(Cxx_Compilers, bitDepth, "C++ compiler", ref Default[bitDepth].cxx_compiler));
 }
 Cxx_Linker(
     EBit bitDepth)
 {
     return(GetTool <LinkerTool>(Cxx_Linkers, bitDepth, "C++ linker", ref Default[bitDepth].cxx_linker));
 }
Example #15
0
 Assembler(
     EBit bitDepth)
 {
     return(GetTool <AssemblerTool>(Assemblers, bitDepth, "Assembler"));
 }
Example #16
0
 WinResource_Compiler(
     EBit bitDepth)
 {
     return(GetTool <WinResourceCompilerTool>(WinResourceCompilers, bitDepth, "Windows resource compiler"));
 }
 WinResource_Compiler(
     EBit bitDepth)
 {
     return(GetTool <WinResourceCompilerTool>(WinResourceCompilers, bitDepth, "Windows resource compiler", ref Default[bitDepth].winres_compiler));
 }
 Librarian(
     EBit bitDepth)
 {
     return(GetTool <LibrarianTool>(Archivers, bitDepth, "librarian", ref Default[bitDepth].librarian));
 }
Example #19
0
 Librarian(
     EBit bitDepth)
 {
     return(GetTool <LibrarianTool>(Archivers, bitDepth, "librarian"));
 }
 ObjectiveCxx_Compiler(
     EBit bitDepth)
 {
     return(GetTool <CompilerTool>(ObjectiveCxx_Compilers, bitDepth, "Objective C++ compiler", ref Default[bitDepth].objcxx_compiler));
 }
Example #21
0
 Cxx_Linker(
     EBit bitDepth)
 {
     return(GetTool <LinkerTool>(Cxx_Linkers, bitDepth, "C++ linker"));
 }
 Assembler(
     EBit bitDepth)
 {
     return(GetTool <AssemblerTool>(Assemblers, bitDepth, "Assembler", ref Default[bitDepth].assembler));
 }
Example #23
0
 ObjectiveCxx_Compiler(
     EBit bitDepth)
 {
     return(GetTool <CompilerTool>(ObjectiveCxx_Compilers, bitDepth, "Objective C++ compiler"));
 }