pass setup_info to the builder's #run method
This commit is contained in:
parent
5de52620e4
commit
4ed584701a
@ -301,7 +301,8 @@ module Rscons
|
|||||||
job[:sources],
|
job[:sources],
|
||||||
cache,
|
cache,
|
||||||
job[:vars],
|
job[:vars],
|
||||||
allow_delayed_execution: true)
|
allow_delayed_execution: true,
|
||||||
|
setup_info: job[:setup_info])
|
||||||
unless result.is_a?(ThreadedCommand)
|
unless result.is_a?(ThreadedCommand)
|
||||||
unless result
|
unless result
|
||||||
raise BuildError.new("Failed to build #{job[:target]}")
|
raise BuildError.new("Failed to build #{job[:target]}")
|
||||||
@ -554,11 +555,15 @@ module Rscons
|
|||||||
# @param sources [Array<String>] List of source files.
|
# @param sources [Array<String>] List of source files.
|
||||||
# @param cache [Cache] The Cache.
|
# @param cache [Cache] The Cache.
|
||||||
# @param vars [Hash] Extra variables to pass to the builder.
|
# @param vars [Hash] Extra variables to pass to the builder.
|
||||||
# @param options [Hash] Options.
|
# @param options [Hash]
|
||||||
|
# @since 1.10.0
|
||||||
|
# Options.
|
||||||
# @option options [Boolean] :allow_delayed_execution
|
# @option options [Boolean] :allow_delayed_execution
|
||||||
# @since 1.10.0
|
# @since 1.10.0
|
||||||
# Allow a threaded command to be scheduled but not yet completed before
|
# Allow a threaded command to be scheduled but not yet completed before
|
||||||
# this method returns.
|
# this method returns.
|
||||||
|
# @option options [Object] :setup_info
|
||||||
|
# Arbitrary builder info returned by Builder#setup.
|
||||||
#
|
#
|
||||||
# @return [String,false] Return value from the {Builder}'s +run+ method.
|
# @return [String,false] Return value from the {Builder}'s +run+ method.
|
||||||
def run_builder(builder, target, sources, cache, vars, options = {})
|
def run_builder(builder, target, sources, cache, vars, options = {})
|
||||||
@ -593,7 +598,8 @@ module Rscons
|
|||||||
sources: sources,
|
sources: sources,
|
||||||
cache: cache,
|
cache: cache,
|
||||||
env: self,
|
env: self,
|
||||||
vars: vars)
|
vars: vars,
|
||||||
|
setup_info: options[:setup_info])
|
||||||
else
|
else
|
||||||
rv = builder.run(target, sources, cache, self, vars)
|
rv = builder.run(target, sources, cache, self, vars)
|
||||||
end
|
end
|
||||||
|
@ -170,7 +170,7 @@ module Rscons
|
|||||||
cache = "cache"
|
cache = "cache"
|
||||||
expect(Cache).to receive(:instance).and_return(cache)
|
expect(Cache).to receive(:instance).and_return(cache)
|
||||||
allow(cache).to receive(:clear_checksum_cache!)
|
allow(cache).to receive(:clear_checksum_cache!)
|
||||||
expect(env).to receive(:run_builder).with(anything, "a.out", ["main.c"], cache, {}, allow_delayed_execution: true).and_return(true)
|
expect(env).to receive(:run_builder).with(anything, "a.out", ["main.c"], cache, {}, allow_delayed_execution: true, setup_info: nil).and_return(true)
|
||||||
expect(cache).to receive(:write)
|
expect(cache).to receive(:write)
|
||||||
|
|
||||||
env.process
|
env.process
|
||||||
@ -184,8 +184,8 @@ module Rscons
|
|||||||
cache = "cache"
|
cache = "cache"
|
||||||
expect(Cache).to receive(:instance).and_return(cache)
|
expect(Cache).to receive(:instance).and_return(cache)
|
||||||
allow(cache).to receive(:clear_checksum_cache!)
|
allow(cache).to receive(:clear_checksum_cache!)
|
||||||
expect(env).to receive(:run_builder).with(anything, "main.o", ["other.cc"], cache, {}, allow_delayed_execution: true).and_return("main.o")
|
expect(env).to receive(:run_builder).with(anything, "main.o", ["other.cc"], cache, {}, allow_delayed_execution: true, setup_info: nil).and_return("main.o")
|
||||||
expect(env).to receive(:run_builder).with(anything, "a.out", ["main.o"], cache, {}, allow_delayed_execution: true).and_return("a.out")
|
expect(env).to receive(:run_builder).with(anything, "a.out", ["main.o"], cache, {}, allow_delayed_execution: true, setup_info: nil).and_return("a.out")
|
||||||
expect(cache).to receive(:write)
|
expect(cache).to receive(:write)
|
||||||
|
|
||||||
env.process
|
env.process
|
||||||
@ -199,7 +199,7 @@ module Rscons
|
|||||||
cache = "cache"
|
cache = "cache"
|
||||||
expect(Cache).to receive(:instance).and_return(cache)
|
expect(Cache).to receive(:instance).and_return(cache)
|
||||||
allow(cache).to receive(:clear_checksum_cache!)
|
allow(cache).to receive(:clear_checksum_cache!)
|
||||||
expect(env).to receive(:run_builder).with(anything, "main.o", ["other.cc"], cache, {}, allow_delayed_execution: true).and_return(false)
|
expect(env).to receive(:run_builder).with(anything, "main.o", ["other.cc"], cache, {}, allow_delayed_execution: true, setup_info: nil).and_return(false)
|
||||||
expect(cache).to receive(:write)
|
expect(cache).to receive(:write)
|
||||||
|
|
||||||
expect { env.process }.to raise_error BuildError, /Failed.to.build.main.o/
|
expect { env.process }.to raise_error BuildError, /Failed.to.build.main.o/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user