parent
bdb57cf62a
commit
4256c0dae2
7 changed files with 54 additions and 1 deletions
@ -0,0 +1,5 @@ |
||||
int number_returner(); |
||||
|
||||
int main(int argc, char **argv) { |
||||
return number_returner() == 100 ? 0 : 1; |
||||
} |
@ -0,0 +1 @@ |
||||
number_returner |
@ -0,0 +1,15 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import sys |
||||
import pathlib |
||||
|
||||
[ifilename, ofilename] = sys.argv[1:3] |
||||
|
||||
ftempl = '''int %s() { |
||||
return @NUMBER@; |
||||
} |
||||
''' |
||||
|
||||
d = pathlib.Path(ifilename).read_text().split('\n')[0].strip() |
||||
|
||||
pathlib.Path(ofilename).write_text(ftempl % d) |
@ -1,3 +1,14 @@ |
||||
x = find_program('converter.py') |
||||
|
||||
meson.override_find_program('codegen', x) |
||||
|
||||
# Override a command with a generated script |
||||
|
||||
cdata = configuration_data() |
||||
|
||||
cdata.set('NUMBER', 100) |
||||
numprog = configure_file(input : 'gencodegen.py.in', |
||||
output : 'gencodegen.py', |
||||
configuration : cdata) |
||||
|
||||
meson.override_find_program('gencodegen', numprog) |
||||
|
Loading…
Reference in new issue