diff options
| author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-11-08 18:55:15 +0530 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-11-09 11:30:09 -0500 |
| commit | 5fdac48250c0e4a7ad6e9b92041ab7b4d1bd02ec (patch) | |
| tree | 5fe297ef6c3c52cbeeb28fac43786d2a4d5126db /test cases/common | |
| parent | 4d8e3be08f5d6a426f64fb6a1f71c9f52b249311 (diff) | |
| download | meson-5fdac48250c0e4a7ad6e9b92041ab7b4d1bd02ec.tar.gz | |
custom_target: Substitute @OUTPUT@ and @INPUT properly
They weren't being substituted if they were a part of a command
argument, ala --output=@OUTPUT@, etc.
Closes https://github.com/mesonbuild/meson/issues/824
Diffstat (limited to 'test cases/common')
| -rw-r--r-- | test cases/common/56 custom target/meson.build | 2 | ||||
| -rwxr-xr-x | test cases/common/56 custom target/my_compiler.py | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/test cases/common/56 custom target/meson.build b/test cases/common/56 custom target/meson.build index e216bae6c..feaa76269 100644 --- a/test cases/common/56 custom target/meson.build +++ b/test cases/common/56 custom target/meson.build @@ -9,7 +9,7 @@ comp = '@0@/@1@'.format(meson.current_source_dir(), 'my_compiler.py') mytarget = custom_target('bindat', output : 'data.dat', input : 'data_source.txt', -command : [python, comp, '@INPUT@', '@OUTPUT@'], +command : [python, comp, '--input=@INPUT@', '--output=@OUTPUT@'], install : true, install_dir : 'subdir' ) diff --git a/test cases/common/56 custom target/my_compiler.py b/test cases/common/56 custom target/my_compiler.py index d99029bcc..4ba2da64e 100755 --- a/test cases/common/56 custom target/my_compiler.py +++ b/test cases/common/56 custom target/my_compiler.py @@ -3,13 +3,14 @@ import sys if __name__ == '__main__': - if len(sys.argv) != 3: - print(sys.argv[0], 'input_file output_file') + if len(sys.argv) != 3 or not sys.argv[1].startswith('--input') or \ + not sys.argv[2].startswith('--output'): + print(sys.argv[0], '--input=input_file --output=output_file') sys.exit(1) - with open(sys.argv[1]) as f: + with open(sys.argv[1].split('=')[1]) as f: ifile = f.read() if ifile != 'This is a text only input file.\n': print('Malformed input') sys.exit(1) - with open(sys.argv[2], 'w') as ofile: + with open(sys.argv[2].split('=')[1], 'w') as ofile: ofile.write('This is a binary output file.\n') |
