class Daedalus::LibraryGroup

The purpose of a LibraryGroup is to combine multiple static and shared libraries into a unit. Static libraries are used to statically link a program, while shared libraries may be dynamically loaded by that program or another program.

NOTE: The current protocol for getting a list of static libraries is the objects method. This should be changed when reworking Daedalus.

Attributes

cflags[RW]
ldflags[RW]

Public Class Methods

new(base, compiler) { |self| ... } click to toggle source
    # File lib/daedalus.rb
727 def initialize(base, compiler)
728   @base = base
729   @static_libraries = []
730   @shared_libraries = []
731   @compiler = Compiler.new(compiler.cc,
732                            compiler.cxx,
733                            compiler.ldshared,
734                            compiler.ldsharedxx,
735                            compiler.log, nil)
736 
737   yield self
738 
739   compiler.add_library self
740 
741   @compiler.cflags.concat cflags if cflags
742   @compiler.ldflags.concat ldflags if ldflags
743 end

Public Instance Methods

clean() click to toggle source
    # File lib/daedalus.rb
781 def clean
782   libraries.each { |l| l.clean }
783 end
consider(compiler, tasks) click to toggle source
    # File lib/daedalus.rb
774 def consider(compiler, tasks)
775   # TODO: Note we are using @compiler, not compiler. There should not be a
776   # global compiler. There should be a global configuration object that is
777   # specialized by specific libraries as needed.
778   libraries.each { |l| l.consider @compiler, tasks }
779 end
depends_on(file, command) click to toggle source
    # File lib/daedalus.rb
745 def depends_on(file, command)
746   # TODO: HACK, the agony, this should be implicit
747   unless File.exist? File.join(@base, file)
748     raise "library group #{@base} depends on #{file}, please run #{command}"
749   end
750 end
libraries() click to toggle source
    # File lib/daedalus.rb
770 def libraries
771   @static_libraries + @shared_libraries
772 end
objects() click to toggle source

TODO: Fix this protocol

    # File lib/daedalus.rb
766 def objects
767   @static_libraries.map { |l| l.path }
768 end
path() click to toggle source

TODO: change the way files are sorted

    # File lib/daedalus.rb
753 def path
754   @base
755 end
shared_library(path, &block) click to toggle source
    # File lib/daedalus.rb
761 def shared_library(path, &block)
762   @shared_libraries << SharedLibrary.new(path, @base, @compiler, &block)
763 end
static_library(path, &block) click to toggle source
    # File lib/daedalus.rb
757 def static_library(path, &block)
758   @static_libraries << StaticLibrary.new(path, @base, @compiler, &block)
759 end