Skip to content

Commit

Permalink
tests/fortran: use fs.copyfile
Browse files Browse the repository at this point in the history
Since the comment saying we need a generic way to do this is a little
outdated.
  • Loading branch information
dcbaker committed Aug 26, 2024
1 parent 5208522 commit 4fc923e
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions test cases/fortran/7 generated/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,7 @@ conf_data = configuration_data()
conf_data.set('ONE', 1)
conf_data.set('TWO', 2)

mod3_f = custom_target(
'mod3.f',
input : 'mod3.f90',
output : 'mod3.f90',
# We need a platform agnostic way to do a copy a file, using a custom_target
# and we need to use the @OUTDIR@, not @OUTPUT@ in order to exercise
# https://github.com/mesonbuild/meson/issues/9258
command : [
find_program('python', 'python3'), '-c',
'import sys, shutil; shutil.copy(sys.argv[1], sys.argv[2])',
'@INPUT@', '@OUTDIR@',
],
)

mod3_f = import('fs').copyfile('mod3.f90', 'mod3.f90')
three = library('mod3', mod3_f)

templates_basenames = ['mod2', 'mod1']
Expand Down

0 comments on commit 4fc923e

Please sign in to comment.