diff options
-rwxr-xr-x | backends.py | 2 | ||||
-rw-r--r-- | test cases/common/31 find program/meson.build | 26 |
2 files changed, 19 insertions, 9 deletions
diff --git a/backends.py b/backends.py index c92201a..d0e0367 100755 --- a/backends.py +++ b/backends.py @@ -438,6 +438,8 @@ class NinjaBackend(Backend): outfile.write('rule %s\n' % rule.name) command = ' '.join([ninja_quote(x) for x in rule.cmd_list]) command = command.replace('@INFILE@', '$in').replace('@OUTFILE@', '$out') + command = command.replace('@SOURCE_ROOT@', self.environment.get_source_dir()) + command = command.replace('@BUILD_ROOT@', self.environment.get_build_dir()) outfile.write(' command = %s\n' % command) desc = rule.description.replace('@INFILE@', '$in') outfile.write(' description = %s\n' % desc) diff --git a/test cases/common/31 find program/meson.build b/test cases/common/31 find program/meson.build index 61913e9..f466d95 100644 --- a/test cases/common/31 find program/meson.build +++ b/test cases/common/31 find program/meson.build @@ -1,12 +1,20 @@ project('find program', 'c') -cp = find_program('cp', required : true) +if host.name() == 'windows' + # Things Windows does not provide: + # - an executable to copy files without prompting + # - working command line quoting + # - anything that you might actually need + # Because of these reasons we only check that + # the program can be found. + cp = find_program('xcopy', required : true) +else + cp = find_program('cp', required : true) + gen = generator(cp, \ + output_name : '@BASENAME@.c', \ + arguments : ['@INPUT@', '@OUTPUT@']) - -gen = generator(cp, \ - output_name : '@BASENAME@.c', \ - arguments : ['@INPUT@', '@OUTPUT@']) - -generated = gen.process('source.in') -e = executable('prog', generated) -add_test('external exe', e) + generated = gen.process('source.in') + e = executable('prog', generated) + add_test('external exe', e) +endif |