class Cxxproject::Toolchain::Provider
Public Class Methods
[](name)
click to toggle source
# File lib/cxxproject/toolchain/provider.rb, line 164 def self.[](name) return @@settings[name] if @@settings.include? name nil end
add(name, basedOn = nil)
click to toggle source
# File lib/cxxproject/toolchain/provider.rb, line 115 def self.add(name, basedOn = nil) chain = Marshal.load(Marshal.dump(basedOn.nil? ? @@default : @@settings[basedOn])) @@settings[name] = chain chain end
default()
click to toggle source
# File lib/cxxproject/toolchain/provider.rb, line 142 def self.default @@default end
list()
click to toggle source
# File lib/cxxproject/toolchain/provider.rb, line 169 def self.list return @@settings end
merge(hashA,hashB,overwrite=true)
click to toggle source
merge hashB into hashA recurse on sub-hash-structures elements present in hashA only will be taken from hashA elements present in hashB only will be taken from hashB elements present in both will be taken from hashB
# File lib/cxxproject/toolchain/provider.rb, line 127 def self.merge(hashA,hashB,overwrite=true) missingKeys = hashB.keys - hashA.keys missingKeys.each do |k| hashA[k] = hashB[k] end hashA.each do |k,v| if v.is_a? Hash merge(v,hashB[k],overwrite) if hashB[k] else hashA[k] = hashB[k] if hashB[k] and overwrite end end hashA end
modify_compiler(based_on, compiler_type, h)
click to toggle source
# File lib/cxxproject/toolchain/provider.rb, line 153 def self.modify_compiler(based_on, compiler_type, h) chain = @@settings[based_on] raise "unknown toolchain: #{based_on}" unless chain chain[:COMPILER][compiler_type].update(h) chain end
modify_cpp_compiler(based_on, h)
click to toggle source
# File lib/cxxproject/toolchain/provider.rb, line 160 def self.modify_cpp_compiler(based_on, h) modify_compiler(based_on, :CPP, h) end
modify_linker(based_on, h)
click to toggle source
# File lib/cxxproject/toolchain/provider.rb, line 146 def self.modify_linker(based_on, h) chain = @@settings[based_on] raise "unknown toolchain: #{based_on}" unless chain chain[:LINKER].update(h) chain end