create Builder instance for each build operation - close #88
This commit is contained in:
1 parent
12f1909d35
commit
aac32d20b0
28 files changed
+181
-147
No files matched your search
@@ -1,12 +1,12 @@
|
||||
class MyObject < Rscons::Builder
|
||||
def run(target, sources, cache, env, vars)
|
||||
env.run_builder(env.builders["Object"], target, sources, cache, vars)
|
||||
env.run_builder(env.builders["Object"].new, target, sources, cache, vars)
|
||||
end
|
||||
end
|
||||
|
||||
build do
|
||||
Environment.new(echo: :command) do |env|
|
||||
env.add_builder(MyObject.new)
|
||||
env.add_builder(MyObject)
|
||||
env.append('CPPPATH' => Rscons.glob('src/**'))
|
||||
env.add_build_hook do |build_op|
|
||||
if build_op[:builder].name == "MyObject" && build_op[:sources].first =~ %r{one\.c}
|
||||
|
||||
@@ -9,7 +9,7 @@ end
|
||||
build do
|
||||
Environment.new do |env|
|
||||
env.echo = :command
|
||||
env.add_builder(MyBuilder.new)
|
||||
env.add_builder(MyBuilder)
|
||||
env.MyBuilder("foo")
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user