parent
1ffc8de5e8
commit
fb770e1e3d
10 changed files with 123 additions and 16 deletions
@ -0,0 +1,12 @@ |
||||
## Dist scripts |
||||
|
||||
You can now specify scripts that are run as part of the `dist` |
||||
target. An example usage would go like this: |
||||
|
||||
```meson |
||||
project('foo', 'c') |
||||
|
||||
# other stuff here |
||||
|
||||
meson.add_dist_script('dist_cleanup.py') |
||||
``` |
@ -0,0 +1,7 @@ |
||||
project('dist script', 'c', |
||||
version : '1.0.0') |
||||
|
||||
exe = executable('comparer', 'prog.c') |
||||
test('compare', exe) |
||||
|
||||
meson.add_dist_script('replacer.py') |
@ -0,0 +1,7 @@ |
||||
#include<string.h> |
||||
|
||||
#define REPLACEME "incorrect" |
||||
|
||||
int main(int argc, char **argv) { |
||||
return strcmp(REPLACEME, "correct"); |
||||
} |
@ -0,0 +1,12 @@ |
||||
#!/usr/bin/env python3 |
||||
|
||||
import os, sys |
||||
import pathlib |
||||
|
||||
source_root = pathlib.Path(os.environ['MESON_DIST_ROOT']) |
||||
|
||||
modfile = source_root / 'prog.c' |
||||
|
||||
contents = modfile.read_text() |
||||
contents = contents.replace('"incorrect"', '"correct"') |
||||
modfile.write_text(contents) |
Loading…
Reference in new issue