pass extra construction variables to Builder#run()

This commit is contained in:
josh committed 2013-09-12 22:57:22 -04:00
1 parent 75f2418570
commit 837dff9374
5 files changed
+18 -13

No files matched your search

+3 -3
View File
@@ -38,12 +38,12 @@ module Rscons
source.has_suffix?(env['CXXSUFFIX']))
end
def run(target, sources, cache, env)
vars = {
def run(target, sources, cache, env, vars = {})
vars = vars.merge({
'TARGET' => target,
'SOURCES' => sources,
'DEPFILE' => target.set_suffix('.mf'),
}
})
com_prefix = if sources.first.has_suffix?(env['ASSUFFIX'])
'AS'
elsif sources.first.has_suffix?(env['CSUFFIX'])
+4 -4
View File
@@ -14,19 +14,19 @@ module Rscons
}
end
def run(target, sources, cache, env)
def run(target, sources, cache, env, vars = {})
# build sources to linkable objects
objects = env.build_sources(sources, [env['OBJSUFFIX'], env['LIBSUFFIX']].flatten, cache)
objects = env.build_sources(sources, [env['OBJSUFFIX'], env['LIBSUFFIX']].flatten, cache, vars)
if objects
use_cxx = sources.map do |s|
s.has_suffix?(env['CXXSUFFIX'])
end.any?
ld_alt = use_cxx ? env['CXX'] : env['CC']
vars = {
vars = vars.merge({
'TARGET' => target,
'SOURCES' => objects,
'LD' => env['LD'] || ld_alt,
}
})
command = env.build_command(env['LDCOM'], vars)
unless cache.up_to_date?(target, command, objects)
return false unless env.execute("LD #{target}", command)