Class: Uttk::Strategies::Compile

Inherits:
Proxy show all
Includes:
Concrete
Defined in:
lib/uttk/strategies/Compile.rb

Overview

I’m not maintained that much since the Package strategy do a better job than I. Can be useful if you have only few files to compile and do not have a Makefile.

Instance Attribute Summary

Attributes inherited from Strategy

#status

Instance Method Summary collapse

Methods inherited from Proxy

#create

Methods inherited from Composite

#<<, #contents, #create, #initialize, #initialize_copy, #initialize_test

Methods inherited from Strategy

#abort, #assert_cmd, #assign, #clean_instance_variables, #display_unexpected_exc, #display_unexpected_synflow_exc, #fail, #initialize, #initialize_flow_factory, #mk_system_runner, #name=, #pass, #raise_error, #reject, #run, #running?, #skip, #skip_if_cached, #skip_pass, #skip_wrt_rpath_and_rpath_exclude, #strategy, #strategy=, #symbols=, #symtbl, #symtbl=, #testify, #timeout=, to_form, #to_s, to_yaml_type, #wclass=

Constructor Details

This class inherits a constructor from Uttk::Strategies::Composite

Instance Method Details

#mk_commandObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/uttk/strategies/Compile.rb', line 18

def mk_command
  # Build compiling command
  command = ''
  unless @source_dir.nil?
    @source_dir = Pathname.new(@source_dir)
    @source.map! { |file| @source_dir + file }
  end
  command << @compiler << ' ' << @flags
  @include.each do |dir|
    command << ' -I ' << dir
  end
  command << ' ' << @source.join(' ')
  command << ' -o ' << @bin
end

#prologueObject



33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/uttk/strategies/Compile.rb', line 33

def prologue
  super
  test = create(self, Cmd)
  test.name = 'internal command'
  test.exit = 0
  test.fatal = true
  test.command = mk_command

  # Configure output
  test.reject :exit
  test.reject :fatal
end