Class: UnionLibrary
- Defined in:
- lib/makeconf/library.rb
Overview
UnionLibrary - combine multiple static libraries into a single library.
The :sources for this library should be an array of Library objects
Instance Attribute Summary
Attributes inherited from Library
Attributes inherited from Buildable
#buildable, #cflags, #distributable, #enable, #id, #installable, #ldadd, #localdep, #output, #output_type, #project, #rpath, #sources, #sysdep, #topdir
Instance Method Summary collapse
-
#initialize(options) ⇒ UnionLibrary
constructor
A new instance of UnionLibrary.
Methods inherited from Buildable
#binary?, #build, #expand_sources, #finalize, #library?, #library_type, #makedepends, #objects
Constructor Details
#initialize(options) ⇒ UnionLibrary
Returns a new instance of UnionLibrary.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/makeconf/library.rb', line 52 def initialize() raise ArgumentError unless .kind_of?(Hash) @buildable = [] [:sources].each do |x| x.buildable.each do |y| @buildable.push y if y.kind_of?(StaticLibrary) end end @buildable.flatten! # Build a list of all source files within each component library sources = [] @buildable.each { |x| sources.push x.sources } sources.flatten! @buildable.push StaticLibrary.new( :id => [:id], :sources => sources ) end |