add build test using a build directory

This commit is contained in:
josh committed 2013-07-15 19:14:52 -04:00
1 parent 741f5cfe5e
commit 2cb584312e
7 files changed
+46 -13

No files matched your search

+14 -12
View File
@@ -18,23 +18,25 @@ module Rscons
if source.has_suffix?([@env['OBJSUFFIX'], @env['LIBSUFFIX']])
source
else
o_file = source.set_suffix(@env['OBJSUFFIX', :string])
o_file = @env.get_build_fname(source, @env['OBJSUFFIX', :string])
builder = @env.builders.values.find { |b| b.produces?(o_file, source) }
builder or raise "No builder found to convert input source #{source.inspect} to an object file."
builder.run(o_file, [source], cache)
builder.run(o_file, [source], cache) or break
end
end
vars = {
'TARGET' => target,
'SOURCES' => sources,
'LD' => @env['LD'] || @env['CC'], # TODO: figure out whether to use CC or CXX
}
command = @env.build_command(@env['LDCOM'], vars)
unless cache.up_to_date?(target, command, sources)
return false unless @env.execute("LD #{target}", command)
cache.register_build(target, command, sources)
if sources
vars = {
'TARGET' => target,
'SOURCES' => sources,
'LD' => @env['LD'] || @env['CC'], # TODO: figure out whether to use CC or CXX
}
command = @env.build_command(@env['LDCOM'], vars)
unless cache.up_to_date?(target, command, sources)
return false unless @env.execute("LD #{target}", command)
cache.register_build(target, command, sources)
end
target
end
target
end
end
end
+1 -1
View File
@@ -99,7 +99,7 @@ module Rscons
def execute(short_desc, command)
if @varset[:echo] == :command
puts command.map { |c| c =~ /\s/ ? "'#{c}'" : c }.join(' ')
puts command.map { |c| c =~ /\s/ ? "'#{c}'" : c }.join(' ')
elsif @varset[:echo] == :short
puts short_desc
end