From 37337f80d5dbb934d25972fa703c0dfd48af0b8f Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 27 Jun 2013 21:20:18 -0400 Subject: [PATCH] specify the type desired for some *SUFFIX variables when they are used --- lib/rscons/builders/cc.rb | 5 +++-- lib/rscons/builders/program.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/rscons/builders/cc.rb b/lib/rscons/builders/cc.rb index 51423c8..3a1c645 100644 --- a/lib/rscons/builders/cc.rb +++ b/lib/rscons/builders/cc.rb @@ -6,13 +6,14 @@ module Rscons 'CFLAGS' => [], 'CPPFLAGS' => [], 'OBJSUFFIX' => '.o', - 'CSUFFIX' => ['.c'], + 'CSUFFIX' => '.c', 'CCCOM' => ['$CC', '-c', '-o', '$TARGET', '$CPPFLAGS', '$CFLAGS', '$SOURCES'] } end def self.produces?(env, target, source) - target =~ /#{env['OBJSUFFIX']}$/ and env['CSUFFIX'].find {|ext| source =~ /#{ext}$/} + (env['OBJSUFFIX', :array].find {|os| target =~ /#{os}$/} and + env['CSUFFIX', :array].find {|cs| source =~ /#{cs}$/}) end def run(env, target, source) diff --git a/lib/rscons/builders/program.rb b/lib/rscons/builders/program.rb index 2e1976a..0f89929 100644 --- a/lib/rscons/builders/program.rb +++ b/lib/rscons/builders/program.rb @@ -19,7 +19,7 @@ module Rscons if source =~ /#{env['OBJSUFFIX']}$/ or source =~ /#{env['LIBSUFFIX']}$/ source else - o_file = env.stem(source) + env['OBJSUFFIX'] + o_file = env.stem(source) + env['OBJSUFFIX', :string] builder_class = env.builders.values.find { |klass| klass.produces?(env, o_file, source) } if builder_class builder = builder_class.new