add build test for custom builders
This commit is contained in:
1 parent
2cb584312e
commit
5dee51b21c
4 files changed
+34
-1
No files matched your search
@@ -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
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include "inc.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
printf("The value is %d\n", THE_VALUE);
|
||||
}
|
||||
Reference in new issue
Block a user