Workaround for configure_file(copy:true)

The `copy` keyword argument of `configure_file()` first appears in
meson 0.47. Now performing file copy via python.
This commit is contained in:
Veloman Yunkan 2020-08-06 19:30:19 +04:00 committed by Matthieu Gautier
parent e8cc6e4205
commit 18e46969b7
1 changed files with 17 additions and 1 deletions

View File

@ -28,9 +28,25 @@ if gtest_dep.found() and not meson.is_cross_build()
'corner_cases.zim'
]
foreach file : data_files
# configure_file(input : 'data/' + file,
# output : file,
# copy: true )
#
# Above (commented) command doesn't work with Meson versions below 0.47
# (in which the 'copy' keyword was first introduced). We want to keep
# compatibility with Ubuntu 18.04 Bionic (which has Meson version 0.45)
# until its EOL.
#
# Below is a python based workaround.
configure_file(input : 'data/' + file,
output : file,
copy: true )
command: [
find_program('python3'),
'-c',
'import sys; import shutil; shutil.copy(sys.argv[1], sys.argv[2])',
'@INPUT@',
'@OUTPUT@'
])
endforeach
foreach test_name : tests