Class: Compiler

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

Direct Known Subclasses

GccCompiler

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(targetDir, defines, compileflags) ⇒ Compiler

Returns a new instance of Compiler.



4
5
6
7
8
# File 'lib/rakepp/compiler.rb', line 4

def initialize(targetDir, defines, compileflags)
  @targetDir = targetDir
  @defines = defines
  @compileflags = compileflags
end

Instance Attribute Details

#compileflagsObject (readonly)

Returns the value of attribute compileflags.



2
3
4
# File 'lib/rakepp/compiler.rb', line 2

def compileflags
  @compileflags
end

#targetDirObject (readonly)

Returns the value of attribute targetDir.



2
3
4
# File 'lib/rakepp/compiler.rb', line 2

def targetDir
  @targetDir
end

Instance Method Details

#add_tasks(artifact) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/rakepp/compiler.rb', line 10

def add_tasks(artifact)
  if (artifact.instance_of?(Exe)) then
    add_exe_tasks(artifact)
  elsif (artifact.instance_of?(SourceLib)) then
    add_source_lib_tasks(artifact)
  elsif (artifact.instance_of?(ObjectFile)) then
    add_object_tasks(artifact)
  elsif (artifact.instance_of?(Framework)) then
    add_framework_tasks(artifact)
  elsif (artifact.instance_of?(BinaryLib)) then
    add_binary_lib_tasks(artifact)
  elsif (artifact.instance_of?(SharedLib)) then
    add_shared_lib_tasks(artifact)
  else
    raise "unknown type " + artifact.to_s
  end
end