add build test for custom builders

This commit is contained in:
josh committed 2013-07-15 20:46:00 -04:00
1 parent 2cb584312e
commit 5dee51b21c
4 files changed
+34 -1

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
class MySource < Rscons::Builder
def run(target, sources, cache)
File.open(target, 'w') do |fh|
fh.puts <<EOF
#define THE_VALUE 5678
EOF
end
target
end
end
Rscons::Environment.new(echo: :short) do |env|
env.add_builder(MySource.new(env))
env.MySource('inc.h', [])
env.Program('program', Dir['*.c'])
end
+7
View File
@@ -0,0 +1,7 @@
#include <stdio.h>
#include "inc.h"
int main(int argc, char *argv[])
{
printf("The value is %d\n", THE_VALUE);
}