parent
d882b6fbd4
commit
f31142de88
4 changed files with 36 additions and 5 deletions
@ -0,0 +1,9 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import sys |
||||
import shutil |
||||
|
||||
if '@INPUT1@' in sys.argv[1]: |
||||
shutil.copyfile(sys.argv[2], sys.argv[3]) |
||||
else: |
||||
sys.exit('String @INPUT1@ not found in "{}"'.format(sys.argv[1])) |
@ -0,0 +1,6 @@ |
||||
#include <stdio.h> |
||||
|
||||
int main() { |
||||
printf("foo is working.\n"); |
||||
return 0; |
||||
} |
@ -0,0 +1,17 @@ |
||||
project('custom target template substitution', 'c') |
||||
|
||||
check = find_program('checkcopy.py') |
||||
|
||||
config = configuration_data() |
||||
|
||||
in = configure_file(configuration : config, output : 'x@IN') |
||||
|
||||
# Check that substitution does not find @foo@ and then misses @INPUT0@. |
||||
# Check the resulting x@INPUT1@ is not replaced. |
||||
foo = custom_target('runcheck', |
||||
input : [in, 'foo.c.in'], |
||||
output : 'foo.c', |
||||
command : [check, '-D@foo@INPUT0@PUT1@', '@INPUT1@', '@OUTPUT@'] |
||||
) |
||||
|
||||
executable('foo', foo) |
Loading…
Reference in new issue