class Rmk::LinkerLikeProcessor

Processors similar to linkers

Attributes

exe_object_files[R]

object files that are linked to binaries/programs

lib_object_files[R]

object files that are linked to library

shx_object_files[R]

Object files that are linked to single shared object (e.g., Matlab MEX). Each value is a hash as passed to Rmk::Generator#add_object.

Public Class Methods

new() click to toggle source
Calls superclass method Rmk::Processor.new
# File lib/processors.rb, line 219
def initialize
  super
  @lib_object_files = []
  @exe_object_files = []
  @shx_object_files = []
  @slot = SLOTS[:linker]
end

Public Instance Methods

add_object(*file) click to toggle source

add object file (or list of files)

# File lib/processors.rb, line 257
def add_object(*file)
  @lib_object_files += file
end
find_sources() click to toggle source
# File lib/processors.rb, line 227
def find_sources
  raise 'invalid call'
end
ninja_begin(_writer = generator.ninja) click to toggle source
# File lib/processors.rb, line 261
def ninja_begin(_writer = generator.ninja)
  collect_object_files
end

Protected Instance Methods

collect_object_files() click to toggle source
# File lib/processors.rb, line 231
def collect_object_files
  generator.object_files.each do |f|
    next if exclude?(f)

    mof = generator.main_object_files[f]
    type = if mof.is_a?(Hash)
             mof[:type]
           else
             mof
           end
    case type
    when :main
      exe_object_files << f
    when :shared_main
      raise "expected Hash for '#{mof.class}'" unless mof.is_a?(Hash)
      shx_object_files << (mof.merge file: f)
    else
      raise "invalid type '#{type}'" if mof
      lib_object_files << f
    end
  end
end