`configure_file` is both an extremely complicated implementation, and a strange place for copying. It's a bit of a historical artifact, since the fs module didn't yet exist. It makes more sense to move this to the fs module and deprecate this `configure_file` version. This new version works at build time rather than configure time, which has the disadvantage it can't be passed to `run_command`, but with the advantage that changes to the input don't require a full reconfigure.pull/10108/head
parent
f93886192e
commit
991baf56e9
5 changed files with 129 additions and 7 deletions
@ -0,0 +1,17 @@ |
||||
## `fs.copyfile` to replace `configure_file(copy : true)` |
||||
|
||||
A new method has been added to the `fs` module, `copyfile`. This method replaces |
||||
`configure_file(copy : true)`, but only copies files. Unlike `configure_file()` |
||||
it runs at build time, and the output name is optional defaulting to the |
||||
filename without paths of the input if unset: |
||||
|
||||
```meson |
||||
fs.copyfile('src/file.txt') |
||||
``` |
||||
Will create a file in the current build directory called `file.txt` |
||||
|
||||
|
||||
```meson |
||||
fs.copyfile('file.txt', 'outfile.txt') |
||||
``` |
||||
Will create a copy renamed to `outfile.txt` |
Loading…
Reference in new issue