Class: Autorake::CheckLibrary

Inherits:
Check
  • Object
show all
Defined in:
lib/autorake/definition.rb

Constant Summary collapse

TYPE =
"library"

Instance Method Summary collapse

Methods inherited from Add

#initialize, #perform

Constructor Details

This class inherits a constructor from Autorake::Add

Instance Method Details

#build_sourceObject



281
282
283
284
285
# File 'lib/autorake/definition.rb', line 281

def build_source
  "int main( int argc, char *argv[]) { return 0; }\n  SRC\nend\n"

#check!Object



292
293
294
# File 'lib/autorake/definition.rb', line 292

def check!
  super or raise "Library missing: #@name."
end

#compile(t) ⇒ Object



286
287
288
289
290
291
# File 'lib/autorake/definition.rb', line 286

def compile t
  c = Compiler.new @config.incdirs, @config.macros, "-w"
  c.cc t.obj, t.src
  l = Linker.new @config.libdirs, [ @name], "-w"
  l.cc t.bin, t.obj
end

#set!Object



295
296
297
# File 'lib/autorake/definition.rb', line 295

def set!
  @config.libs.push @name
end