diff options
author | 2023-10-10 14:33:42 +0000 | |
---|---|---|
committer | 2023-10-10 14:33:42 +0000 | |
commit | af1a266670d040d2f4083ff309d732d648afba2a (patch) | |
tree | 2fc46203448ddcc6f81546d379abfaeb323575e9 /meson/test cases/fortran/7 generated/meson.build | |
parent | e02cda008591317b1625707ff8e115a4841aa889 (diff) |
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'meson/test cases/fortran/7 generated/meson.build')
-rw-r--r-- | meson/test cases/fortran/7 generated/meson.build | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meson/test cases/fortran/7 generated/meson.build b/meson/test cases/fortran/7 generated/meson.build new file mode 100644 index 000000000..b555b1744 --- /dev/null +++ b/meson/test cases/fortran/7 generated/meson.build @@ -0,0 +1,29 @@ +# Tests whether fortran sources files created during configuration are properly +# scanned for dependency information + +project('generated', 'fortran', + default_options : ['default_library=static']) + +conf_data = configuration_data() +conf_data.set('ONE', 1) +conf_data.set('TWO', 2) +conf_data.set('THREE', 3) + +configure_file(input : 'mod3.fpp', output : 'mod3.f90', configuration : conf_data) +# Manually build absolute path to source file to test +# https://github.com/mesonbuild/meson/issues/7265 +three = library('mod3', meson.current_build_dir() / 'mod3.f90') + +templates_basenames = ['mod2', 'mod1'] +generated_sources = [] +foreach template_basename : templates_basenames + infilename = '@0@.fpp'.format(template_basename) + outfilename = '@0@.f90'.format(template_basename) + outfile = configure_file( + input : infilename, output : outfilename, configuration : conf_data) + generated_sources += [outfile] +endforeach + +sources = ['prog.f90'] + generated_sources +exe = executable('generated', sources, link_with: three) +test('generated', exe) |