Module: Bake::Plugins::Cpp::MainTarget
- Included in:
- Executable, Library
- Defined in:
- lib/bake/plugins/cpp.rb
Overview
MainTarget
is a mix-in for the Library
and Executable
classes containing code common to both types of targets.
Instance Method Summary collapse
- #add_dep(target) ⇒ Object
- #build ⇒ Object
-
#stale? ⇒ Boolean
A special override of
stale?
that ignores changes to dlls when determining if this target is stale.
Instance Method Details
#add_dep(target) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/bake/plugins/cpp.rb', line 45 def add_dep(target) if target.is_a?(FileTarget) target = Source.new(self, toolset, target) end return super if !target.is_a?(Source) deps << Cpp::Object.new(self, toolset, target) end |
#build ⇒ Object
53 54 55 |
# File 'lib/bake/plugins/cpp.rb', line 53 def build toolset.build(self) end |
#stale? ⇒ Boolean
A special override of stale?
that ignores changes to dlls when determining if this target is stale. The only case in which a lib or exe should have to update when a dll dependency is updated is when the interface changes. Since exes and libs depend on the headers implicitly, they will be updated if the interface changes automatically.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/bake/plugins/cpp.rb', line 34 def stale? return @stale if !@stale.nil? tmin = mtimes.min @stale = deps.any? do |dep| is_dll = dep.is_a?(Library) && dep[:libtype] == 'dynamic' (dep.stale? || dep.mtimes.max > tmin) && !is_dll end return @stale end |