Object builder changes in preparation for adding SharedObject

This commit is contained in:
Josh Holtrop 2017-05-30 16:26:39 -04:00
parent 19a23c2aa9
commit 6bd7e6f852
2 changed files with 13 additions and 8 deletions

View File

@ -62,17 +62,19 @@ module Rscons
# Return whether this builder object is capable of producing a given target
# file name from a given source file name.
#
# @param target [String] The target file name.
# @param source [String] The source file name.
# @param env [Environment] The Environment.
# @param options [Hash]
# Options.
#
# @return [Boolean]
# Whether this builder object is capable of producing a given target
# file name from a given source file name.
def produces?(target, source, env)
target.end_with?(*env['OBJSUFFIX']) and KNOWN_SUFFIXES.find do |compiler, suffix_var|
source.end_with?(*env[suffix_var])
end
def produces?(options)
target, source, env, features = options.values_at(:target, :source, :env, :features)
(not features[:shared]) and
target.end_with?(*env['OBJSUFFIX']) and
KNOWN_SUFFIXES.find do |compiler, suffix_var|
source.end_with?(*env[suffix_var])
end
end
# Run the builder to produce a build target.

View File

@ -972,7 +972,10 @@ module Rscons
if builder.method(:produces?).arity == 3
builder.produces?(options[:target], options[:source], self)
else
builder.produces?(options.merge(env: self))
options = options.dup
options[:features] ||= {}
options[:env] = self
builder.produces?(options)
end
end