Merge pull request #1788 from aradi/fix-fortran-scan
Fix scanning of Fortran sources created during configurationpull/1779/merge
commit
08bd92a6ae
5 changed files with 49 additions and 4 deletions
@ -0,0 +1,22 @@ |
||||
# Tests whether fortran sources files created during configuration are properly |
||||
# scanned for dependency information |
||||
|
||||
project('generated', 'fortran') |
||||
|
||||
conf_data = configuration_data() |
||||
conf_data.set('ONE', 1) |
||||
conf_data.set('TWO', 2) |
||||
|
||||
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) |
||||
test('generated', exe) |
@ -0,0 +1,6 @@ |
||||
module mod1 |
||||
implicit none |
||||
|
||||
integer, parameter :: modval1 = @ONE@ |
||||
|
||||
end module mod1 |
@ -0,0 +1,7 @@ |
||||
module mod2 |
||||
use mod1 |
||||
implicit none |
||||
|
||||
integer, parameter :: modval2 = @TWO@ |
||||
|
||||
end module mod2 |
@ -0,0 +1,9 @@ |
||||
program prog |
||||
use mod2 |
||||
implicit none |
||||
|
||||
if (modval1 + modval2 /= 3) then |
||||
stop 1 |
||||
end if |
||||
|
||||
end program prog |
Loading…
Reference in new issue