OverrideDefaultSettings( Bam.Core.Settings settings) { var cSettings = settings as C.ICommonCompilerSettings; cSettings.Bits = C.EBit.ThirtyTwo; }
OverrideDefaultSettings( Bam.Core.Settings settings) { var cSettings = settings as C.ICommonCompilerSettings; cSettings.Bits = C.EBit.SixtyFour; }
OverrideDefaultSettings( Bam.Core.Settings settings) { var cSettings = settings as C.ICommonCompilerSettings; cSettings.TargetLanguage = C.ETargetLanguage.ObjectiveCxx; }
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:"); } } }
CompileAsShared( Bam.Core.Settings settings) { var gccCompiler = settings as GccCommon.ICommonCompilerSettings; gccCompiler.PositionIndependentCode = true; }
Convert( System.Type conversionClass, Bam.Core.Settings toolSettings, Bam.Core.StringArray commandLine) { var stringArrayType = typeof(Bam.Core.StringArray); foreach (var i in toolSettings.Interfaces()) { var method = conversionClass.GetMethod("Convert", new[] { i, stringArrayType }); if (null == method) { throw new Bam.Core.Exception("Unable to locate method {0}.Convert({1}, {2})", conversionClass.ToString(), i.ToString(), stringArrayType); } var commands = new Bam.Core.StringArray(); try { method.Invoke(null, new object[] { toolSettings, commands }); } catch (System.Reflection.TargetInvocationException exception) { throw new Bam.Core.Exception(exception.InnerException, "Command line conversion error:"); } commandLine.AddRange(commands); } }
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:"); } } }
OverrideDefaultSettings( Bam.Core.Settings settings) { base.OverrideDefaultSettings(settings); var cSettings = settings as C.ICommonCompilerSettings; cSettings.TargetLanguage = C.ETargetLanguage.Cxx; }
OverrideDefaultSettings( Bam.Core.Settings settings) { var compiler = settings as C.ICommonCompilerSettings; compiler.TargetLanguage = C.ETargetLanguage.ObjectiveC; var cCompiler = settings as C.ICOnlyCompilerSettings; cCompiler.LanguageStandard = C.ELanguageStandard.C99; }
CreateDeltaSettings( Bam.Core.Settings sharedSettings, Bam.Core.Module module) { var attributeType = typeof(Bam.Core.SettingsExtensionsAttribute); var moduleSpecificSettings = System.Activator.CreateInstance(module.Settings.GetType(), module, false) as SettingsBase; var sharedInterfaces = sharedSettings.Interfaces(); foreach (var i in module.Settings.Interfaces()) { var attributeArray = i.GetCustomAttributes(attributeType, false); if (0 == attributeArray.Length) { throw new Bam.Core.Exception("Settings interface {0} is missing attribute {1}", i.ToString(), attributeType.ToString()); } var attribute = attributeArray[0] as Bam.Core.SettingsExtensionsAttribute; // if we match any of the shared interfaces, get a delta // otherwise, just clone the interface if (sharedInterfaces.Any(item => item == i)) { var deltaMethod = attribute.GetMethod("Delta", new[] { i, i, i }); if (null != deltaMethod) { Bam.Core.Log.DebugMessage("Executing {0}", deltaMethod.Name); deltaMethod.Invoke(null, new[] { moduleSpecificSettings, this, sharedSettings }); } else { throw new Bam.Core.Exception("Unable to find method {0}.Delta(this {1}, {1}, {1)", attribute.ExtensionsClassName, i.ToString()); } } else { var cloneMethod = attribute.GetMethod("Clone", new[] { i, i }); if (null != cloneMethod) { Bam.Core.Log.DebugMessage("Executing {0}", cloneMethod.Name); cloneMethod.Invoke(null, new[] { moduleSpecificSettings, this }); } else { throw new Bam.Core.Exception("Unable to find method {0}.Clone(this {1}, {1})", attribute.ExtensionsClassName, i.ToString()); } } } return(moduleSpecificSettings); }
AddSourceFile( Bam.Core.Module module, Bam.Core.Settings patchSettings) { var settings = module.MetaData as VSSettingsGroup; if (null != patchSettings) { (patchSettings as VisualStudioProcessor.IConvertToProject).Convert(module, settings, condition: this.ConditionText); } this.Sources.AddUnique(settings); this.Project.AddSource(settings); }
AddResourceFile( C.WinResource resource, Bam.Core.Settings patchSettings) { var settings = resource.MetaData as VSSettingsGroup; if (null != patchSettings) { (patchSettings as VisualStudioProcessor.IConvertToProject).Convert(resource, settings, condition: this.ConditionText); } var resourceGroup = this.Project.GetUniqueSettingsGroup(this.Module, VSSettingsGroup.ESettingsGroup.Resource, resource.InputPath); this.Project.AddResourceFile(resourceGroup); }
AddAssemblyFile( C.AssembledObjectFile assembler, Bam.Core.Settings patchSettings) { var settings = assembler.MetaData as VSSettingsGroup; if (null != patchSettings) { (patchSettings as VisualStudioProcessor.IConvertToProject).Convert(assembler, settings, condition: this.ConditionText); } var assemblyGroup = this.Project.GetUniqueSettingsGroup(this.Module, VSSettingsGroup.ESettingsGroup.CustomBuild, assembler.InputPath); this.AssemblyFiles.AddUnique(assemblyGroup); this.Project.AddAssemblyFile(assemblyGroup); }
Tweak( Bam.Core.Settings settings) { // if Pedantic is variable among sources, and there are warning suppressions, // take the default of Pedantic as true // this is because the Xcode build setting for Pedantic appears BEFORE warning // suppressions, and if -Wpedantic appears in per-file overrides, this appears // AFTER warning suppressions, effectively undoing any that come under the // Pedantic umbrella if (null == (settings as ClangCommon.ICommonCompilerSettings).Pedantic && (settings as ICommonCompilerSettings).DisableWarnings.Any()) { (settings as ClangCommon.ICommonCompilerSettings).Pedantic = true; } }
CompileAsShared( Bam.Core.Settings settings) { }
OverrideDefaultSettings( Bam.Core.Settings settings);