Class: CrossTools

Inherits:
Object
  • Object
show all
Defined in:
lib/rakepp/crosstools.rb

Instance Method Summary collapse

Constructor Details

#initialize(compilerHash) ⇒ CrossTools

Returns a new instance of CrossTools.



3
4
5
# File 'lib/rakepp/crosstools.rb', line 3

def initialize(compilerHash)
  @compilerHash = compilerHash
end

Instance Method Details

#exe(compilers, base, name, sources, libs, includes) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/rakepp/crosstools.rb', line 25

def exe(compilers, base, name, sources, libs, includes)
  todo = get_compilers(compilers)
  return todo.inject(Hash.new) do |memo, pair|
    key = pair[0]
    compiler = pair[1]
    l = libs[key]
    if l == nil
      raise "missing libs for exe: '#{name}' and compiler: '#{key}'"
    end
    memo[key] = Exe.new(compiler, base, name, sources, l, includes)
    memo
  end
end

#get_compilers(compilers) ⇒ Object



39
40
41
42
43
44
45
46
47
48
# File 'lib/rakepp/crosstools.rb', line 39

def get_compilers(compilers)
  if compilers == nil
    return @compilerHash
  else
    return compilers.inject(Hash.new) do |memo, i|
      memo[i] =  @compilerHash[i]
      memo
    end
  end
end

#source_lib(compilers, base, name, sources, dependencies, includes, privateDefines = [], forceLib = false) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rakepp/crosstools.rb', line 7

def source_lib(compilers, base, name, sources, dependencies, includes, privateDefines=[], forceLib=false)
  todo = get_compilers(compilers)
  return todo.inject(Hash.new) do |memo, pair|
    key = pair[0]
    compiler = pair[1]
    deps = dependencies[key]
    if deps == nil
      if dependencies.size == 0
        deps = Array.new
      else
        raise "missing deps for sourcelib: '#{name}' and compiler: '#{key}'"
      end
    end
    memo[key] = [SourceLib.new(compiler, base, name, sources, deps, includes, privateDefines, forceLib)]
    memo
  end
end