Class: Rscons::Builders::Program

Inherits:
Rscons::Builder show all
Includes:
Mixins::ObjectDeps, Mixins::Program
Defined in:
lib/rscons/builders/program.rb

Overview

A default Rscons builder that knows how to link object files into an executable program.

Instance Attribute Summary

Attributes inherited from Rscons::Builder

#build_step, #cache, #env, #preferred_ld, #side_effects, #sources, #target, #vars

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixins::Program

#run

Methods included from Mixins::ObjectDeps

#register_object_deps

Methods inherited from Rscons::Builder

#depends, extra_path, #finalize_command, name, #name, #nop?, #print_run_message, #produces, #register_command, #run, #standard_command, #wait_for

Constructor Details

#initialize(options) ⇒ Program

Create an instance of the Builder to build a target.



26
27
28
29
# File 'lib/rscons/builders/program.rb', line 26

def initialize(options)
  super(options)
  @objects = register_object_deps(Object)
end

Class Method Details

.new(options, *more) ⇒ Object

Custom new method which will delegate to the correct class depending on the options specified.



13
14
15
16
17
18
19
20
21
22
# File 'lib/rscons/builders/program.rb', line 13

def new(options, *more)
  unless File.basename(options[:target])["."]
    options[:target] += options[:env].expand_varref("${PROGSUFFIX}", options[:vars])
  end
  if options[:vars][:direct]
    Object.new(options, *more)
  else
    super
  end
end