public RegisterWinResourceCompilerAttribute(
     string toolsetName,
     Bam.Core.EPlatform platform,
     EBit bitDepth)
     :
     base(toolsetName, platform, bitDepth)
 {}
예제 #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)
 {
 }
예제 #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)
 {
 }
예제 #8
0
 protected ToolRegistrationAttribute(
     string toolsetName,
     Bam.Core.EPlatform platform,
     EBit bitDepth)
 {
     this.ToolsetName = toolsetName;
     this.Platform    = platform;
     this.BitDepth    = bitDepth;
 }
예제 #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;
 }
예제 #11
0
        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);
        }
예제 #12
0
 Cxx_Compiler(
     EBit bitDepth)
 {
     return(GetTool <CompilerTool>(Cxx_Compilers, bitDepth, "C++ compiler"));
 }
예제 #13
0
 Cxx_Compiler(
     EBit bitDepth)
 {
     return(GetTool <CompilerTool>(Cxx_Compilers, bitDepth, "C++ compiler", ref Default[bitDepth].cxx_compiler));
 }
예제 #14
0
 Cxx_Linker(
     EBit bitDepth)
 {
     return(GetTool <LinkerTool>(Cxx_Linkers, bitDepth, "C++ linker", ref Default[bitDepth].cxx_linker));
 }
예제 #15
0
 Assembler(
     EBit bitDepth)
 {
     return(GetTool <AssemblerTool>(Assemblers, bitDepth, "Assembler"));
 }
예제 #16
0
 WinResource_Compiler(
     EBit bitDepth)
 {
     return(GetTool <WinResourceCompilerTool>(WinResourceCompilers, bitDepth, "Windows resource compiler"));
 }
예제 #17
0
 WinResource_Compiler(
     EBit bitDepth)
 {
     return(GetTool <WinResourceCompilerTool>(WinResourceCompilers, bitDepth, "Windows resource compiler", ref Default[bitDepth].winres_compiler));
 }
예제 #18
0
 Librarian(
     EBit bitDepth)
 {
     return(GetTool <LibrarianTool>(Archivers, bitDepth, "librarian", ref Default[bitDepth].librarian));
 }
예제 #19
0
 Librarian(
     EBit bitDepth)
 {
     return(GetTool <LibrarianTool>(Archivers, bitDepth, "librarian"));
 }
예제 #20
0
 ObjectiveCxx_Compiler(
     EBit bitDepth)
 {
     return(GetTool <CompilerTool>(ObjectiveCxx_Compilers, bitDepth, "Objective C++ compiler", ref Default[bitDepth].objcxx_compiler));
 }
예제 #21
0
 Cxx_Linker(
     EBit bitDepth)
 {
     return(GetTool <LinkerTool>(Cxx_Linkers, bitDepth, "C++ linker"));
 }
예제 #22
0
 Assembler(
     EBit bitDepth)
 {
     return(GetTool <AssemblerTool>(Assemblers, bitDepth, "Assembler", ref Default[bitDepth].assembler));
 }
예제 #23
0
 ObjectiveCxx_Compiler(
     EBit bitDepth)
 {
     return(GetTool <CompilerTool>(ObjectiveCxx_Compilers, bitDepth, "Objective C++ compiler"));
 }