From 6bd7e6f852a65e72e91aae1552faa04d77d6be89 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 30 May 2017 16:26:39 -0400 Subject: [PATCH] Object builder changes in preparation for adding SharedObject --- lib/rscons/builders/object.rb | 16 +++++++++------- lib/rscons/environment.rb | 5 ++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/rscons/builders/object.rb b/lib/rscons/builders/object.rb index 798d56b..6822021 100644 --- a/lib/rscons/builders/object.rb +++ b/lib/rscons/builders/object.rb @@ -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. diff --git a/lib/rscons/environment.rb b/lib/rscons/environment.rb index 12fe3ba..38fd1d9 100644 --- a/lib/rscons/environment.rb +++ b/lib/rscons/environment.rb @@ -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