Class: CppEngine

Inherits:
Object
  • Object
show all
Includes:
DslLoader
Defined in:
lib/cpp_engine.rb,
lib/cpp_engine/dsl_loader.rb

Defined Under Namespace

Modules: DslLoader Classes: Compiler

Constant Summary collapse

OBJ_DIR =
"build/objs"

Instance Method Summary collapse

Methods included from DslLoader

#compile, #load

Constructor Details

#initialize(root_path = ".") ⇒ CppEngine

Returns a new instance of CppEngine.



3
4
5
6
# File 'lib/cpp_engine.rb', line 3

def initialize root_path="."
    @root_path=root_path
    @compilers=[]
end

Instance Method Details

#grep_cpp_files(source_patterns) ⇒ Object



20
21
22
23
24
25
26
27
28
# File 'lib/cpp_engine.rb', line 20

def grep_cpp_files source_patterns
    @cpp_files=[]

    source_patterns.each{|pattern|
        @cpp_files+=Dir[pattern]
    }
    return @cpp_files

end

#runObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/cpp_engine.rb', line 8

def run
    @compilers.each{|compiler|
        compiler.compile
        compiler.link
    }

  #  compiler=Compiler.new
  #  compiler.compile @cpp_files
  #  compiler.link
    
end