Shameful hack to get configure files working with custom targets. Needs to be fixed properly during file object refactoring.
parent
4e097ec702
commit
94bc5f4033
6 changed files with 33 additions and 0 deletions
@ -0,0 +1 @@ |
||||
@VALUE@ |
@ -0,0 +1,6 @@ |
||||
cdata = configuration_data() |
||||
cdata.set('VALUE', '42') |
||||
|
||||
cfile = configure_file(input : 'confdata.in', |
||||
output : 'confdata', |
||||
configuration : cdata) |
@ -0,0 +1,4 @@ |
||||
project('conf file in custom target', 'c') |
||||
|
||||
subdir('inc') |
||||
subdir('src') |
@ -0,0 +1,4 @@ |
||||
custom_target('thing', |
||||
output : 'final.dat', |
||||
input : cfile, |
||||
command : [find_program('mycompiler.py'), '@INPUT@', '@OUTPUT@']) |
@ -0,0 +1,8 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import sys |
||||
|
||||
ifile = open(sys.argv[1]) |
||||
if ifile.readline().strip() != '42': |
||||
print('Incorrect input') |
||||
open(sys.argv[2], 'w').write('Success\n') |
Loading…
Reference in new issue