Object builder changes in preparation for adding SharedObject
This commit is contained in:
parent
19a23c2aa9
commit
6bd7e6f852
@ -62,17 +62,19 @@ module Rscons
|
|||||||
# Return whether this builder object is capable of producing a given target
|
# Return whether this builder object is capable of producing a given target
|
||||||
# file name from a given source file name.
|
# file name from a given source file name.
|
||||||
#
|
#
|
||||||
# @param target [String] The target file name.
|
# @param options [Hash]
|
||||||
# @param source [String] The source file name.
|
# Options.
|
||||||
# @param env [Environment] The Environment.
|
|
||||||
#
|
#
|
||||||
# @return [Boolean]
|
# @return [Boolean]
|
||||||
# Whether this builder object is capable of producing a given target
|
# Whether this builder object is capable of producing a given target
|
||||||
# file name from a given source file name.
|
# file name from a given source file name.
|
||||||
def produces?(target, source, env)
|
def produces?(options)
|
||||||
target.end_with?(*env['OBJSUFFIX']) and KNOWN_SUFFIXES.find do |compiler, suffix_var|
|
target, source, env, features = options.values_at(:target, :source, :env, :features)
|
||||||
source.end_with?(*env[suffix_var])
|
(not features[:shared]) and
|
||||||
end
|
target.end_with?(*env['OBJSUFFIX']) and
|
||||||
|
KNOWN_SUFFIXES.find do |compiler, suffix_var|
|
||||||
|
source.end_with?(*env[suffix_var])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Run the builder to produce a build target.
|
# Run the builder to produce a build target.
|
||||||
|
@ -972,7 +972,10 @@ module Rscons
|
|||||||
if builder.method(:produces?).arity == 3
|
if builder.method(:produces?).arity == 3
|
||||||
builder.produces?(options[:target], options[:source], self)
|
builder.produces?(options[:target], options[:source], self)
|
||||||
else
|
else
|
||||||
builder.produces?(options.merge(env: self))
|
options = options.dup
|
||||||
|
options[:features] ||= {}
|
||||||
|
options[:env] = self
|
||||||
|
builder.produces?(options)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user