Debian Codegraph @

vendored-meson/meson/test cases/fortran/7 generated/meson.build

raw
1 # Tests whether fortran sources files created during configuration are properly
2 # scanned for dependency information
3
4 project('generated', 'fortran',
5 default_options : ['default_library=static'])
6
7 conf_data = configuration_data()
8 conf_data.set('ONE', 1)
9 conf_data.set('TWO', 2)
10
11 mod3_f = import('fs').copyfile('mod3.f90', 'mod3.f90')
12 three = library('mod3', mod3_f)
13
14 templates_basenames = ['mod2', 'mod1']
15 generated_sources = []
16 foreach template_basename : templates_basenames
17 infilename = '@[email protected]'.format(template_basename)
18 outfilename = '@[email protected]'.format(template_basename)
19 outfile = configure_file(
20 input : infilename, output : outfilename, configuration : conf_data)
21 generated_sources += [outfile]
22 endforeach
23
24 sources = ['prog.f90'] + generated_sources
25 exe = executable('configure_file', sources, link_with: three)
26 test('configure_file', exe)
27
28 gen = generator(
29 find_program('gen.py'),
30 arguments : [
31 '@INPUT@', '@OUTPUT@',
32 '--replace', '@ONE@=1',
33 '--replace', '@TWO@=2',
34 ],
35 output : ['@[email protected]'],
36 )
37
38 exe = executable(
39 'generator',
40 'prog.f90', gen.process('mod1.fpp', 'mod2.fpp'),
41 link_with: three,
42 )
43 test('generator', exe)