pass environment to builder functions instead of as an initialization parameter

This commit is contained in:
josh committed 2013-07-15 21:41:33 -04:00
1 parent bcfeadeebf
commit c9f6bdb2e2
5 files changed
+19 -21

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
class MySource < Rscons::Builder
def run(target, sources, cache)
def run(target, sources, cache, env)
File.open(target, 'w') do |fh|
fh.puts <<EOF
#define THE_VALUE 5678
@@ -10,7 +10,7 @@ EOF
end
Rscons::Environment.new(echo: :short) do |env|
env.add_builder(MySource.new(env))
env.add_builder(MySource.new)
env.MySource('inc.h', [])
env.Program('program', Dir['*.c'])
end