Skip to content

Commit 595aa80

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

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
@@ -57,12 +57,17 @@ endif
5757
# Suppose we do if and only if the meson.build file is tracked by git.
5858
cmd_py = '''
5959
import shutil, subprocess, sys
60-
if not shutil.which('git'):
60+
git_exe = shutil.which('git')
61+
if not git_exe:
6162
sys.exit(1)
62-
cmd = [ 'git', 'ls-files', '--error-unmatch', 'meson.build' ]
63-
sys.exit(subprocess.run(cmd, cwd="@0@", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode)
64-
'''.format(project_source_root)
65-
is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() == 0
63+
cmd = [ git_exe, 'ls-files', '--error-unmatch', 'meson.build' ]
64+
sys.exit(subprocess.run(cmd, cwd=sys.argv[1], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode)
65+
'''
66+
is_git_build = run_command(
67+
python3, '-c', cmd_py,
68+
project_source_root,
69+
check: false,
70+
).returncode() == 0
6671

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

0 commit comments

Comments
 (0)