Class: Magica::Target

Inherits:
Build show all
Defined in:
lib/magica/target.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Build

Build::COMMANDS, Build::COMPILERS

Instance Attribute Summary

Attributes inherited from Build

#defines, #flags, #include_paths, #options, #sources

Instance Method Summary collapse

Methods inherited from Build

#add, #build_task, #clean, #clear_dest, #clear_exe, #compile, #define, #dest, #do_target, #dynamic_library, #exclude, #exe_name, #exe_path, #exefile, #filename, #flag, #include, #include_path, #initialize, #library, #library_path, #link, #objfile, #source, #toolchain, #use

Constructor Details

This class inherits a constructor from Magica::Build

Instance Method Details

#dependency(name, options = {}, &block) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/magica/target.rb', line 15

def dependency(name, options = {}, &block)
  Dependency.new(name, options, &block)
  task "#{@name}:dependency:#{name}" do
    Dependency[name].build(self)
  end
  @dependencies << "#{@name}:dependency:#{name}"
  @static_libraries.push(*Dependency[name].static_libraries)
end

#target(name, **options, &block) ⇒ Object



8
9
10
11
12
13
# File 'lib/magica/target.rb', line 8

def target(name, **options, &block)
  return if block.nil?
  name = name.to_sym
  @targets[name] = block
  @default_target = name if options[:default]
end