Class: Teapot::Build::Targets::Executable

Inherits:
Library show all
Defined in:
lib/teapot/build/targets/executable.rb

Instance Attribute Summary

Attributes inherited from Library

#options

Attributes inherited from Teapot::Build::Target

#parent

Instance Method Summary collapse

Methods inherited from Library

#build, #compile_and_link, #dependent_libraries, #initialize, #install_file_list

Methods included from Installation

#install_prefix!

Methods included from Compiler

#build_prefix!, #compile, #compile!, #link_prefix!

Methods inherited from Teapot::Build::Target

#configure, #execute, #initialize, #root, target

Constructor Details

This class inherits a constructor from Teapot::Build::Targets::Library

Instance Method Details



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/teapot/build/targets/executable.rb', line 31

def link(environment, objects)
  executable_file = link_prefix!(environment) + @name
      
  graph = Build::dependency_graph(environment)
  
  if graph.regenerate?(executable_file, objects + dependent_libraries(environment))
    Commands.run(
      environment[:cxx],
      environment[:cxxflags],
      "-o", executable_file, objects,
      environment[:ldflags]
    )
  end
  
  return executable_file
end

#subdirectoryObject



27
28
29
# File 'lib/teapot/build/targets/executable.rb', line 27

def subdirectory
  options[:subdirectory] || "bin"
end