add "tweakers" functionality
tweakers allow the user to modify construction variables before any build is performed
This commit is contained in:
1 parent
4a2997feec
commit
446fef931f
3 files changed
+46
-8
No files matched your search
@@ -0,0 +1,12 @@
|
||||
Rscons::Environment.new do |env|
|
||||
env.append('CPPPATH' => Dir['src/**/*/'])
|
||||
env.build_dir(%r{^src/([^/]+)/}, 'build_\\1/')
|
||||
env.add_tweaker do |build_op|
|
||||
if build_op[:target] =~ %r{build_one/.*\.o}
|
||||
build_op[:vars]["CFLAGS"] << "-O1"
|
||||
elsif build_op[:target] =~ %r{build_two/.*\.o}
|
||||
build_op[:vars]["CFLAGS"] << "-O2"
|
||||
end
|
||||
end
|
||||
env.Program('tweaker', Dir['src/**/*.c'])
|
||||
end
|
||||
Reference in new issue
Block a user