Skip to content

Commit c65a883

Browse files
committed
meson.build: Fix the evaluation of is_git_build on Windows
See gtkmm#131
1 parent ce1ddba commit c65a883

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

meson.build

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,17 @@ python3 = find_program('python3', version: '>=3.5')
4747
# Suppose we do if and only if the meson.build file is tracked by git.
4848
cmd_py = '''
4949
import shutil, subprocess, sys
50-
if not shutil.which('git'):
50+
git_exe = shutil.which('git')
51+
if not git_exe:
5152
sys.exit(1)
52-
cmd = [ 'git', 'ls-files', '--error-unmatch', 'meson.build' ]
53-
sys.exit(subprocess.run(cmd, cwd="@0@", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode)
54-
'''.format(project_source_root)
55-
is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() == 0
53+
cmd = [ git_exe, 'ls-files', '--error-unmatch', 'meson.build' ]
54+
sys.exit(subprocess.run(cmd, cwd=sys.argv[1], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode)
55+
'''
56+
is_git_build = run_command(
57+
python3, '-c', cmd_py,
58+
project_source_root,
59+
check: false,
60+
).returncode() == 0
5661

5762
# Are we testing a dist tarball while it's being built?
5863
# There ought to be a better way. https://github.com/mesonbuild/meson/issues/6866

0 commit comments

Comments
 (0)