pass environment to builder functions instead of as an initialization parameter
This commit is contained in:
1 parent
bcfeadeebf
commit
c9f6bdb2e2
5 files changed
+19
-21
No files matched your search
@@ -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
|
||||
Reference in new issue
Block a user